|
86 | 86 | @test relpath(S(joinpath("foo","bar")), S("foo")) == "bar"
|
87 | 87 |
|
88 | 88 | @testset "splitpath" begin
|
89 |
| - @test ["a", "b", "c"] == splitpath(joinpath("a","b","c")) |
90 |
| - @test [] == splitpath("") |
| 89 | + @test splitpath(joinpath("a","b","c")) == ["a", "b", "c"] |
| 90 | + @test splitpath("") == [] |
91 | 91 |
|
92 |
| - @test ["cats are", "gr8t"] == splitpath(joinpath("cats are", "gr8t")) |
93 |
| - @test [" ", " "] == splitpath(joinpath(" ", " ")) |
| 92 | + @test splitpath(joinpath("cats are", "gr8t")) == ["cats are", "gr8t"] |
| 93 | + @test splitpath(joinpath(" ", " ")) == [" ", " "] |
94 | 94 |
|
95 | 95 | # Unix-style paths are understood by all systems.
|
96 |
| - @test ["/", "a", "b"] == splitpath("/a/b") |
97 |
| - @test ["/"] == splitpath("/") |
98 |
| - @test ["a"] == splitpath("a/") |
99 |
| - @test ["a", "b"] == splitpath("a/b/") |
100 |
| - @test ["a.dir", "b.txt"] == splitpath("a.dir/b.txt") |
101 |
| - @test ["/"] == splitpath("///") |
102 |
| - @test ["/", "a", "b"] == splitpath("///a///b///") |
| 96 | + @test splitpath("/a/b") == ["/", "a", "b"] |
| 97 | + @test splitpath("/") == ["/"] |
| 98 | + @test splitpath("a/") == ["a"] |
| 99 | + @test splitpath("a/b/") == ["a", "b"] |
| 100 | + @test splitpath("a.dir/b.txt") == ["a.dir", "b.txt"] |
| 101 | + @test splitpath("///") == ["/"] |
| 102 | + @test splitpath("///a///b///") == ["/", "a", "b"] |
103 | 103 |
|
104 | 104 | if Sys.iswindows()
|
105 |
| - @test ["C:\\", "a", "b", "c"] == splitpath("C:\\\\a\\b\\c") |
106 |
| - @test ["C:\\"] == splitpath("C:\\\\") |
107 |
| - @test ["J:\\"] == splitpath("J:\\") |
108 |
| - @test ["C:"] == splitpath("C:") |
109 |
| - @test ["a"] == splitpath("a\\") |
110 |
| - @test ["a","b"] == splitpath("a\\\\b\\\\") |
111 |
| - @test ["a.dir", "b.txt"] == splitpath("a.dir\\b.txt") |
112 |
| - @test ["\\", "a","b"] == splitpath("\\a\\b\\") |
| 105 | + @test splitpath("C:\\\\a\\b\\c") == ["C:\\", "a", "b", "c"] |
| 106 | + @test splitpath("C:\\\\") == ["C:\\"] |
| 107 | + @test splitpath("J:\\") == ["J:\\"] |
| 108 | + @test splitpath("C:") == ["C:"] |
| 109 | + @test splitpath("a\\") == ["a"] |
| 110 | + @test splitpath("a\\\\b\\\\") == ["a","b"] |
| 111 | + @test splitpath("a.dir\\b.txt") == ["a.dir", "b.txt"] |
| 112 | + @test splitpath("\\a\\b\\") == ["\\", "a","b"] |
113 | 113 |
|
114 |
| - @test ["/", "a", "b", "c", "d", "e"] == splitpath("/a/b\\c/d\\\\e") |
115 |
| - @test ["/"] == splitpath("/\\/\\") |
116 |
| - @test ["\\","a","b"] == splitpath("\\/\\a/\\//b") |
| 114 | + @test splitpath("/a/b\\c/d\\\\e") == ["/", "a", "b", "c", "d", "e"] |
| 115 | + @test splitpath("/\\/\\") == ["/"] |
| 116 | + @test splitpath("\\/\\a/\\//b") == ["\\","a","b"] |
117 | 117 | end
|
118 | 118 | end
|
119 | 119 |
|
|
0 commit comments