Artifact 7e000480ba2f610043ed25467d9d7ecd3abac88010b7037f4c5bd1c82c9062c1:
- File
types_test.go
— part of check-in
[f5744359d3]
at
2026-04-19 16:30:54
on branch trunk
— Initial open source release
libfossil is a pure-Go implementation of the Fossil SCM, reading and writing the same .fossil SQLite repository format as upstream Fossil.
This is the first public release of code that previously lived in a private repository. The module path is github.com/danmestas/libfossil and the binary is named libfossil to avoid $PATH collisions with upstream fossil.
Included: - Repo lifecycle (create, clone), checkout/checkin, timeline, merge, diff, annotate, shun, tag, branch, bisect, stash, undo/redo - Sync-over-HTTP protocol (client and handler) - Two SQLite drivers: modernc (pure Go, default) and ncruces (wasm-capable) - Observer interfaces (SyncObserver, CheckoutObserver) with an optional OpenTelemetry implementation in observer/otel (separate submodule) - Deterministic simulation testing harness with BUGGIFY fault injection - Kong-based embeddable CLI under cli/ and a standalone binary under cmd/libfossil/ (user: [email protected], size: 1068) [annotate] [blame] [check-ins using]
package libfossil import "testing" func TestFslIDIsInt64(t *testing.T) { var id FslID = -1 if id != -1 { t.Fatal("FslID should support negative values") } var big FslID = 1 << 33 if big <= 0 { t.Fatal("FslID should support values > int32 max") } } func TestFslSizePhantom(t *testing.T) { if PhantomSize != -1 { t.Fatalf("PhantomSize = %d, want -1", PhantomSize) } var s FslSize = PhantomSize if s >= 0 { t.Fatal("FslSize should be able to represent -1 for phantoms") } } func TestFossilAppID(t *testing.T) { if FossilApplicationID != 252006673 { t.Fatalf("FossilApplicationID = %d, want 252006673", FossilApplicationID) } } func TestCreateOptsDefaults(t *testing.T) { opts := CreateOpts{} if opts.User != "" { t.Error("default User should be empty") } } func TestSyncOptsDefaults(t *testing.T) { opts := SyncOpts{} if opts.Push || opts.Pull { t.Error("default Push/Pull should be false") } } func TestLogOptsLimit(t *testing.T) { opts := LogOpts{Limit: 10} if opts.Limit != 10 { t.Errorf("got %d, want 10", opts.Limit) } }