Commit b43ea38
authored
fix: interpret path separators per-platform in extract_title_from_path (#585)
extract_title_from_path only ever receives native local paths: the
desktop app and pb CLI pass the opened file's path, and Android copies
content URIs to a local cache file before handing the path to the core.
Treating a backslash as a separator on unix was therefore speculative
generality — and actively wrong, since a backslash is a legal filename
character there (a file named "dir\\" got "Untitled" instead of its
name).
Gate the trailing-backslash check to Windows and split the tests into
platform-independent, Windows-only, and unix-only groups. This fixes
extracts_title_from_path::case_03, which asserted the Windows answer
for a C:\\ path on every platform and failed on macOS.1 parent 5965ce5 commit b43ea38
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
25 | 27 | | |
26 | | - | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
37 | 55 | | |
0 commit comments