Commit c5c515b
authored
test_api: Normalize file name and path (#608)
test_list_notebooks was failing on file systems with unicode
normalization different from the encoding used in the strings. In
particular on macOS with HFS+ I got failures for four of the file names.
This is because HFS+ uses normalization form D while normalization form
C is more commonly used, especially on Linux.
By normalizing the name and path read from disk to NFC we avoid the
mismatch as long as no NFD strings are added to the `dirs` tuples.
There are other unicode normal forms and normalization is not
necessarily invertible so this is not a perfect solution.
I can think of two alternative solutions:
1. Refrain from using any unicode symbols that have different
representations in the various normal forms.
2. Write temporary files to disk somewhere, the read back the paths and
filenames and use those instead of the original strings in the test.1 parent 5931903 commit c5c515b
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
104 | | - | |
105 | | - | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
0 commit comments