|
15 | 15 | (is (= (when h/windows? "C:\\Users\\FirstName LastName\\c.clj") |
16 | 16 | (when h/windows? (shared/uri->filename "file:/c:/Users/FirstName%20LastName/c.clj")))) |
17 | 17 | (is (= (when h/windows? "C:\\c.clj") |
18 | | - (when h/windows? (shared/uri->filename "file:///c:/c.clj")))))) |
| 18 | + (when h/windows? (shared/uri->filename "file:///c:/c.clj"))))) |
| 19 | + (testing "Spaces" |
| 20 | + (is (= (h/file-path "/Users/foo/Library/Some Document/comappleCloudDocs") |
| 21 | + (shared/uri->filename (h/file-uri "file:///Users/foo/Library/Some Document/comappleCloudDocs")))))) |
19 | 22 |
|
20 | 23 | (deftest assoc-some-test |
21 | 24 | (testing "single association" |
|
122 | 125 | (is (= "**" (shared/obfuscate "ab"))) |
123 | 126 | (is (= "****" (shared/obfuscate "abcd")))) |
124 | 127 |
|
125 | | - (testing "default preserve-num=3 with various lengths" |
| 128 | + (testing "default preserve-num=3 with various lengths" |
126 | 129 | ;; length 5: middle forced to at least 5 stars, preserve shrinks to floor(len/2) |
127 | | - (is (= "ab*****de" (shared/obfuscate "abcde"))) |
| 130 | + (is (= "ab*****de" (shared/obfuscate "abcde"))) |
128 | 131 | ;; length 6: prefix 3, 5 stars, suffix 3 => 11 chars |
129 | | - (is (= "abc*****def" (shared/obfuscate "abcdef"))) |
| 132 | + (is (= "abc*****def" (shared/obfuscate "abcdef"))) |
130 | 133 | ;; length 7: prefix 3, 5 stars, suffix 3 => 11 chars |
131 | | - (is (= "abc*****efg" (shared/obfuscate "abcdefg"))) |
| 134 | + (is (= "abc*****efg" (shared/obfuscate "abcdefg"))) |
132 | 135 | ;; length 10: prefix 3, 5 stars, suffix 3 => 11 chars |
133 | | - (is (= "abc*****hij" (shared/obfuscate "abcdefghij")))) |
134 | | - |
135 | | - (testing "respect (bounded) preserve-num" |
| 136 | + (is (= "abc*****hij" (shared/obfuscate "abcdefghij")))) |
| 137 | + |
| 138 | + (testing "respect (bounded) preserve-num" |
136 | 139 | ;; preserve-num smaller than half the length |
137 | | - (is (= "a*****f" (shared/obfuscate "abcdef" :preserve-num 1))) |
| 140 | + (is (= "a*****f" (shared/obfuscate "abcdef" :preserve-num 1))) |
138 | 141 | ;; preserve-num larger than half the length is capped |
139 | | - (is (= "abc*****def" (shared/obfuscate "abcdef" :preserve-num 10))))) |
| 142 | + (is (= "abc*****def" (shared/obfuscate "abcdef" :preserve-num 10))))) |
0 commit comments