Artifact 1a8dd573c7006fa0455c85be8d97693b470f917ee16a5da54e0a4d53e8a443e1:
- File
internal/repo/setting_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: 813) [annotate] [blame] [check-ins using] [more...]
package repo import "testing" // TestSettingBoolean reads a stored setting as fossil's db_get_boolean does: // is_truth wins, then is_false, and anything else keeps the default. func TestSettingBoolean(t *testing.T) { for _, tc := range []struct { value string dflt bool want bool }{ {"on", false, true}, {"YES", false, true}, {"True", false, true}, {"1", false, true}, {" 2x", false, true}, {"-1", false, true}, {"off", true, false}, {"No", true, false}, {"FALSE", true, false}, {"0", true, false}, {"00", true, true}, {"00", false, false}, {"", true, true}, {"junk", true, true}, {"junk", false, false}, {" 0", true, true}, } { if got := SettingBoolean(tc.value, tc.dflt); got != tc.want { t.Errorf("SettingBoolean(%q, %t) = %t, want %t", tc.value, tc.dflt, got, tc.want) } } }