diff --git a/las_dictionary_test.go b/las_dictionary_test.go index 91fe074..fd9b18d 100644 --- a/las_dictionary_test.go +++ b/las_dictionary_test.go @@ -4,6 +4,7 @@ package glasio import ( + "path/filepath" "testing" ) @@ -12,19 +13,19 @@ func TestLoadStdMnemonicDic(t *testing.T) { if err == nil { t.Errorf(" on test 1 return error == nil\n") } - _, err = LoadStdMnemonicDic("data\\mnemonic.ini") //file ini exist, return error == nil + _, err = LoadStdMnemonicDic(filepath.Join("data", "mnemonic.ini")) //file ini exist, return error == nil if err != nil { t.Errorf(" on test 2 expect error = nil, return error: %s\n", err) } - _, err = LoadStdMnemonicDic("data\\mn.ini") //file ini not exist, return error + _, err = LoadStdMnemonicDic(filepath.Join("data", "mn.ini")) //file ini not exist, return error if err == nil { t.Errorf(" on test 3 expect error != nil, return nil\n") } - _, err = LoadStdMnemonicDic("data\\dic.ini") //file ini exist, section not exist, return error != nil + _, err = LoadStdMnemonicDic(filepath.Join("data", "dic.ini")) //file ini exist, section not exist, return error != nil if err == nil { t.Errorf(" on test 4 expect error = nil, return error: %s\n", err) } - _, err = LoadStdMnemonicDic("data\\dic0.ini") //file ini exist, file empty, return error != nil + _, err = LoadStdMnemonicDic(filepath.Join("data", "dic0.ini")) //file ini exist, file empty, return error != nil if err == nil { t.Errorf(" on test 5 expect error = nil, return error: %s\n", err) } @@ -35,19 +36,19 @@ func TestLoadStdVocabularyDictionary(t *testing.T) { if err == nil { t.Errorf(" on test 1 return error == nil\n") } - _, err = LoadStdVocabularyDictionary("data\\dic.ini") //file ini exist, return error == nil + _, err = LoadStdVocabularyDictionary(filepath.Join("data", "dic.ini")) //file ini exist, return error == nil if err != nil { t.Errorf(" on test 2 expect error = nil, return error: %s\n", err) } - _, err = LoadStdVocabularyDictionary("data\\mn.ini") //file ini not exist, return error + _, err = LoadStdVocabularyDictionary(filepath.Join("data", "mn.ini")) //file ini not exist, return error if err == nil { t.Errorf(" on test 3 expect error != nil, return nil\n") } - _, err = LoadStdVocabularyDictionary("data\\mnemonic.ini") //file ini exist, section not exist, return error != nil + _, err = LoadStdVocabularyDictionary(filepath.Join("data", "mnemonic.ini")) //file ini exist, section not exist, return error != nil if err == nil { t.Errorf(" on test 4 expect error = nil, return error: %s\n", err) } - _, err = LoadStdVocabularyDictionary("data\\mnemonic0.ini") //file ini exist, file empty, return error != nil + _, err = LoadStdVocabularyDictionary(filepath.Join("data", "mnemonic0.ini")) //file ini exist, file empty, return error != nil if err == nil { t.Errorf(" on test 5 expect error = nil, return error: %s\n", err) }