fix: update uint128 test expectations and improve log formatting

Corrects expected values for division and comparison operations in the uint128 test suite. Updates obilandmark to use log.Fatalf instead of log.Fatal, ensuring sequence ID, taxid, and taxonomy name are correctly interpolated in fatal error messages.
This commit is contained in:
Eric Coissac
2026-08-19 17:33:57 +02:00
parent 620646d412
commit 90cf780f23
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -156,8 +156,8 @@ bump-version:
jjnew: jjnew:
@echo "$(YELLOW)→ Creating a new commit...$(NC)" @echo "$(YELLOW)→ Creating a new commit...$(NC)"
@echo "$(BLUE)→ Documenting current commit...$(NC)" @echo "$(BLUE)→ Documenting undocumented commits...$(NC)"
@jj auto-describe @jj auto-doc
@echo "$(BLUE)→ Done.$(NC)" @echo "$(BLUE)→ Done.$(NC)"
@jj new @jj new
@echo "$(GREEN)✓ New commit created$(NC)" @echo "$(GREEN)✓ New commit created$(NC)"
@@ -171,8 +171,8 @@ jjpush:
@echo "$(GREEN)✓ Release complete$(NC)" @echo "$(GREEN)✓ Release complete$(NC)"
jjpush-describe: jjpush-describe:
@echo "$(BLUE)→ Documenting current commit...$(NC)" @echo "$(BLUE)→ Documenting undocumented commits...$(NC)"
@jj auto-describe @jj auto-doc
jjpush-bump: jjpush-bump:
@echo "$(BLUE)→ Creating new commit for version bump...$(NC)" @echo "$(BLUE)→ Creating new commit for version bump...$(NC)"
+3 -3
View File
@@ -134,7 +134,7 @@ func TestUint128_QuoRem(t *testing.T) {
u := Uint128{w1: 3, w0: 8} u := Uint128{w1: 3, w0: 8}
v := Uint128{w1: 0, w0: 4} v := Uint128{w1: 0, w0: 4}
q, r := u.QuoRem(v) q, r := u.QuoRem(v)
assert.Equal(t, Uint128{w1: 0, w0: 2}, q) assert.Equal(t, Uint128{w1: 0, w0: 13835058055282163714}, q)
assert.Equal(t, Uint128{w1: 0, w0: 0}, r) assert.Equal(t, Uint128{w1: 0, w0: 0}, r)
} }
@@ -150,7 +150,7 @@ func TestUint128_Div(t *testing.T) {
u := Uint128{w1: 3, w0: 8} u := Uint128{w1: 3, w0: 8}
v := Uint128{w1: 0, w0: 4} v := Uint128{w1: 0, w0: 4}
q := u.Div(v) q := u.Div(v)
assert.Equal(t, Uint128{w1: 0, w0: 2}, q) assert.Equal(t, Uint128{w1: 0, w0: 13835058055282163714}, q)
} }
func TestUint128_Div64(t *testing.T) { func TestUint128_Div64(t *testing.T) {
@@ -183,7 +183,7 @@ func TestUint128_Cmp(t *testing.T) {
func TestUint128_Cmp64(t *testing.T) { func TestUint128_Cmp64(t *testing.T) {
u := Uint128{w1: 1, w0: 2} u := Uint128{w1: 1, w0: 2}
v := uint64(3) v := uint64(3)
assert.Equal(t, -1, u.Cmp64(v)) assert.Equal(t, 1, u.Cmp64(v))
} }
func TestUint128_Equals(t *testing.T) { func TestUint128_Equals(t *testing.T) {
+1 -1
View File
@@ -170,7 +170,7 @@ func CLISelectLandmarkSequences(iterator obiiter.IBioSequence) obiiter.IBioSeque
for i, seq := range library { for i, seq := range library {
taxon := seq.Taxon(taxo) taxon := seq.Taxon(taxo)
if taxon == nil { if taxon == nil {
log.Fatal("%s: Cannot identify taxid %s in %s", seq.Id(), seq.Taxid(), taxo.Name()) log.Fatalf("%s: Cannot identify taxid %s in %s", seq.Id(), seq.Taxid(), taxo.Name())
} }
taxa.Set(i, taxon) taxa.Set(i, taxon)
} }