@@ -20,6 +20,10 @@ func TestUriToPath(t *testing.T) {
20
20
require .NoError (t , err )
21
21
require .Equal (t , "C:/Users/test/Sketch.ino" , d .unbox ())
22
22
23
+ d , err = NewDocumentURIFromURL ("file:///C:/Users/test/Sketch%23suffix.ino" )
24
+ require .NoError (t , err )
25
+ require .Equal (t , "C:/Users/test/Sketch#suffix.ino" , d .unbox ())
26
+
23
27
d , err = NewDocumentURIFromURL ("file:///c%3A/Users/test/Sketch.ino" )
24
28
require .NoError (t , err )
25
29
require .Equal (t , "c:/Users/test/Sketch.ino" , d .unbox ())
@@ -38,9 +42,12 @@ func TestUriToPath(t *testing.T) {
38
42
}
39
43
40
44
func TestPathToUri (t * testing.T ) {
45
+ d := NewDocumentURI ("/Users/test/Sketch#suffix.ino" )
46
+ require .Equal (t , "file:///Users/test/Sketch%23suffix.ino" , d .String ())
47
+
41
48
toSlash = windowsToSlash // Emulate windows cases
42
49
43
- d : = NewDocumentURI ("C:\\ Users\\ test\\ Sketch.ino" )
50
+ d = NewDocumentURI ("C:\\ Users\\ test\\ Sketch.ino" )
44
51
require .Equal (t , "file:///C:/Users/test/Sketch.ino" , d .String ())
45
52
d = NewDocumentURI ("/Users/test/Sketch.ino" )
46
53
require .Equal (t , "file:///Users/test/Sketch.ino" , d .String ())
0 commit comments