diff --git a/source/utils/strings_test.go b/source/utils/strings_test.go index 7c08366a68a064f1514446adf566a69a5ae75ad3..7c3066eb90aaba8f0a1884874db6d9063074139f 100644 --- a/source/utils/strings_test.go +++ b/source/utils/strings_test.go @@ -4,8 +4,10 @@ package utils import ( + "fmt" "os" "path/filepath" + "runtime" "testing" ) @@ -21,11 +23,16 @@ func TestMaskCodeBlocks(t *testing.T) { for _, table := range tables { - p, _ := os.Getwd() + //p, _ := os.Getwd() + _, p, _, _ := runtime.Caller(0) // p = filepath.Dir(p) // go to parent directory p = filepath.Dir(p) // go to parent directory + p = filepath.Dir(p) // go to parent directory + p = filepath.Dir(p) // go to parent directory p = filepath.Join(p, table.input) + fmt.Println(p) + code, err := os.ReadFile(p) if err != nil { t.Errorf("Error reading file %s", table.input)