Artifact 1ab583f6a59ae911b2cd52a4c470b9fcd15ab45f68320ee840944a4249955a1e:
- File
internal/repo/filename_case_test.go
— part of check-in
[430dd5ec70]
at
2026-10-20 01:49:55
on branch fix/cli-path-matching
— fix(cli): match PATH as fossil does; run pragmas in a fixed order
log --path, cat --at and diff drop a leading ./, a trailing / and doubled or /./ separators, and compare names with the repository's case-sensitive setting, fossil's platform default when unset. Not found stays exit 2, where fossil exits 1; the docs now say so. SettingBoolean moves to internal/repo, shared by sync and checkout.
Opening a repository runs every pragma in a fixed order, not only busy_timeout first.
Tracked in #451 (user: [email protected], size: 861) [annotate] [blame] [check-ins using] [more...]
package repo_test import ( "runtime" "testing" ) // TestFilenamesCaseSensitive: the repository's case-sensitive setting wins, // and without one fossil's platform default applies: off on macOS and // Windows, on elsewhere. func TestFilenamesCaseSensitive(t *testing.T) { r := newRepo(t) if got, want := r.FilenamesCaseSensitive(), runtime.GOOS != "darwin" && runtime.GOOS != "windows"; got != want { t.Errorf("no setting on %s: case-sensitive = %t, want the platform default %t", runtime.GOOS, got, want) } for _, tc := range []struct { value string want bool }{{"on", true}, {"OFF", false}, {"yes", true}, {"0", false}} { if err := r.SetConfig("case-sensitive", tc.value); err != nil { t.Fatal(err) } if got := r.FilenamesCaseSensitive(); got != tc.want { t.Errorf("case-sensitive=%q: %t, want %t", tc.value, got, tc.want) } } }