@@ -21,7 +21,7 @@ package pairtree
21
21
22
22
import (
23
23
"os"
24
- "path"
24
+ "path/filepath "
25
25
"testing"
26
26
)
27
27
@@ -55,15 +55,15 @@ func TestCharEncoding(t *testing.T) {
55
55
func TestBasic (t * testing.T ) {
56
56
// Test Basic encoding
57
57
testEncodings := map [string ]string {
58
- "abcd" : path .Join ("ab" , "cd" ) + pathSep ,
59
- "abcdefg" : path .Join ("ab" , "cd" , "ef" , "g" ) + pathSep ,
60
- "12-986xy4" : path .Join ("12" , "-9" , "86" , "xy" , "4" ) + pathSep ,
61
- "2018-06-01" : path .Join ("20" , "18" , "-0" , "6-" , "01" ) + pathSep ,
62
- "a" : path .Join ("a" ) + pathSep ,
63
- "ab" : path .Join ("ab" ) + pathSep ,
64
- "abc" : path .Join ("ab" , "c" ) + pathSep ,
65
- "abcde" : path .Join ("ab" , "cd" , "e" ) + pathSep ,
66
- "mnopqz" : path .Join ("mn" , "op" , "qz" ) + pathSep ,
58
+ "abcd" : filepath .Join ("ab" , "cd" ) + pathSep ,
59
+ "abcdefg" : filepath .Join ("ab" , "cd" , "ef" , "g" ) + pathSep ,
60
+ "12-986xy4" : filepath .Join ("12" , "-9" , "86" , "xy" , "4" ) + pathSep ,
61
+ "2018-06-01" : filepath .Join ("20" , "18" , "-0" , "6-" , "01" ) + pathSep ,
62
+ "a" : filepath .Join ("a" ) + pathSep ,
63
+ "ab" : filepath .Join ("ab" ) + pathSep ,
64
+ "abc" : filepath .Join ("ab" , "c" ) + pathSep ,
65
+ "abcde" : filepath .Join ("ab" , "cd" , "e" ) + pathSep ,
66
+ "mnopqz" : filepath .Join ("mn" , "op" , "qz" ) + pathSep ,
67
67
}
68
68
for src , expected := range testEncodings {
69
69
result := Encode (src )
@@ -88,12 +88,12 @@ func TestBasic(t *testing.T) {
88
88
89
89
func TestAdvanced (t * testing.T ) {
90
90
testData := map [string ]string {
91
- "ark:/13030/xt12t3" : path .Join ("ar" , "k+" , "=1" , "30" , "30" ,
91
+ "ark:/13030/xt12t3" : filepath .Join ("ar" , "k+" , "=1" , "30" , "30" ,
92
92
"=x" , "t1" , "2t" , "3" ) + pathSep ,
93
- "http://n2t.info/urn:nbn:se:kb:repos-1" : path .Join ("ht" , "tp" ,
93
+ "http://n2t.info/urn:nbn:se:kb:repos-1" : filepath .Join ("ht" , "tp" ,
94
94
"+=" , "=n" , "2t" , ",i" , "nf" , "o=" , "ur" , "n+" , "nb" , "n+" ,
95
95
"se" , "+k" , "b+" , "re" , "po" , "s-" , "1" ) + pathSep ,
96
- "what-the-*@?#!^!?" : path .Join ("wh" , "at" , "-t" , "he" , "-^" ,
96
+ "what-the-*@?#!^!?" : filepath .Join ("wh" , "at" , "-t" , "he" , "-^" ,
97
97
"2a" , "@^" , "3f" , "#!" , "^5" , "e!" , "^3" ,
98
98
"f" ) + pathSep ,
99
99
}
@@ -113,7 +113,7 @@ func TestAdvanced(t *testing.T) {
113
113
114
114
func TestUTF8Names (t * testing.T ) {
115
115
testData := map [string ]string {
116
- "Hänggi-P" : path .Join ("Hä" , "ng" , "gi" , "-P" ) + pathSep ,
116
+ "Hänggi-P" : filepath .Join ("Hä" , "ng" , "gi" , "-P" ) + pathSep ,
117
117
}
118
118
for src , expected := range testData {
119
119
result := Encode (src )
0 commit comments