Skip to content

Commit ef2a527

Browse files
miamsclaude
andcommitted
fix(tests): drop stale 'index' column expectations
Commit 7ba726a removed the | startat1 pipeline in favor of a display hook that numbers rows only when rendered to the terminal — the data itself no longer carries an 'index' column. Tests still asserted on that column and were failing 21 times in CI on the v0.3.0 push. Strips 'index' from every column-list assertion in test_db_iiams, test_db_pres2025, and test_tabulate_trees, and removes the two "index starts at 1" tests that no longer match the design. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 39869a7 commit ef2a527

3 files changed

Lines changed: 19 additions & 33 deletions

File tree

tests/test_db_iiams.nu

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def "db-iiams list people iiams - substantially larger than pres2025" [] {
5858
def "db-iiams list people iiams - has expected columns" [] {
5959
if (no-db) { return }
6060
let cols = (with-env (ie) { genq list people } | columns)
61-
for col in [index RIN Given Surname Sex BirthDate DeathDate] {
61+
for col in [RIN Given Surname Sex BirthDate DeathDate] {
6262
assert ($cols | any { |c| $c == $col })
6363
}
6464
}
@@ -94,7 +94,7 @@ def "db-iiams list events iiams - returns records" [] {
9494
def "db-iiams list events iiams - has expected columns" [] {
9595
if (no-db) { return }
9696
let cols = (with-env (ie) { genq list events } | columns)
97-
for col in [index EventID RIN Given Surname Event Description EventDate SortDate LastUpdate] {
97+
for col in [EventID RIN Given Surname Event Description EventDate SortDate LastUpdate] {
9898
assert ($cols | any { |c| $c == $col })
9999
}
100100
}
@@ -162,7 +162,7 @@ def "db-iiams list sources iiams - has expected columns" [] {
162162
let result = (with-env (ie) { genq list sources })
163163
if ($result | length) == 0 { return }
164164
let cols = ($result | columns)
165-
for col in [index SrcID TempID AbbrevSourceName Footnote ShortFootnote Bibliography] {
165+
for col in [SrcID TempID AbbrevSourceName Footnote ShortFootnote Bibliography] {
166166
assert ($cols | any { |c| $c == $col })
167167
}
168168
}
@@ -192,7 +192,7 @@ def "db-iiams list citations iiams - has expected columns" [] {
192192
let result = (with-env (ie) { genq list citations })
193193
if ($result | length) == 0 { return }
194194
let cols = ($result | columns)
195-
for col in [index RIN Surname Givens Source] {
195+
for col in [RIN Surname Givens Source] {
196196
assert ($cols | any { |c| $c == $col })
197197
}
198198
}
@@ -221,7 +221,7 @@ def "db-iiams list findagrave iiams - has expected columns" [] {
221221
let result = (with-env (ie) { genq list findagrave })
222222
if ($result | length) == 0 { return }
223223
let cols = ($result | columns)
224-
for col in [index RIN Name URL] {
224+
for col in [RIN Name URL] {
225225
assert ($cols | any { |c| $c == $col })
226226
}
227227
}
@@ -251,7 +251,7 @@ def "db-iiams list obits iiams - has expected columns" [] {
251251
let result = (with-env (ie) { genq list obits })
252252
if ($result | length) == 0 { return }
253253
let cols = ($result | columns)
254-
for col in [index RIN NewObit] {
254+
for col in [RIN NewObit] {
255255
assert ($cols | any { |c| $c == $col })
256256
}
257257
}
@@ -266,7 +266,7 @@ def "db-iiams list newspaper obits summary iiams - has expected columns" [] {
266266
let result = (with-env (ie) { genq list newspaper obits summary })
267267
if ($result | length) == 0 { return }
268268
let cols = ($result | columns)
269-
for col in [index RIN Newspaper EventID] {
269+
for col in [RIN Newspaper EventID] {
270270
assert ($cols | any { |c| $c == $col })
271271
}
272272
}
@@ -365,7 +365,7 @@ def "db-iiams list names iiams - returns records" [] {
365365
def "db-iiams list names iiams - has expected columns" [] {
366366
if (no-db) { return }
367367
let cols = (with-env (ie) { genq list names } | columns)
368-
for col in [index NameID RIN Surname Given NameType IsPrimary BirthYear DeathYear] {
368+
for col in [NameID RIN Surname Given NameType IsPrimary BirthYear DeathYear] {
369369
assert ($cols | any { |c| $c == $col })
370370
}
371371
}
@@ -402,7 +402,7 @@ def "db-iiams list places iiams - returns records" [] {
402402
def "db-iiams list places iiams - has expected columns" [] {
403403
if (no-db) { return }
404404
let cols = (with-env (ie) { genq list places } | columns)
405-
for col in [index PlaceID Name Normalized PlaceType] {
405+
for col in [PlaceID Name Normalized PlaceType] {
406406
assert ($cols | any { |c| $c == $col })
407407
}
408408
}
@@ -441,7 +441,7 @@ def "db-iiams list children iiams - returns records" [] {
441441
def "db-iiams list children iiams - has expected columns" [] {
442442
if (no-db) { return }
443443
let cols = (with-env (ie) { genq list children } | columns)
444-
for col in [index RIN Given Surname Sex MRIN FatherRIN MotherRIN RelToFather RelToMother] {
444+
for col in [RIN Given Surname Sex MRIN FatherRIN MotherRIN RelToFather RelToMother] {
445445
assert ($cols | any { |c| $c == $col })
446446
}
447447
}
@@ -471,7 +471,7 @@ def "db-iiams list associations iiams - has expected columns when records exist"
471471
let result = (with-env (ie) { genq list associations })
472472
if ($result | length) == 0 { return }
473473
let cols = ($result | columns)
474-
for col in [index FanID RIN1 Given1 Surname1 RIN2 Given2 Surname2 AssocType] {
474+
for col in [FanID RIN1 Given1 Surname1 RIN2 Given2 Surname2 AssocType] {
475475
assert ($cols | any { |c| $c == $col })
476476
}
477477
}
@@ -491,7 +491,7 @@ def "db-iiams list witnesses iiams - returns records" [] {
491491
def "db-iiams list witnesses iiams - has expected columns" [] {
492492
if (no-db) { return }
493493
let cols = (with-env (ie) { genq list witnesses } | columns)
494-
for col in [index WitnessID EventID EventType EventOwnerRIN WitnessRIN Role] {
494+
for col in [WitnessID EventID EventType EventOwnerRIN WitnessRIN Role] {
495495
assert ($cols | any { |c| $c == $col })
496496
}
497497
}
@@ -520,7 +520,7 @@ def "db-iiams list sources all iiams - returns records" [] {
520520
def "db-iiams list sources all iiams - has expected columns" [] {
521521
if (no-db) { return }
522522
let cols = (with-env (ie) { genq list sources --all } | columns)
523-
for col in [index SrcID TempID TemplateName AbbrevSourceName] {
523+
for col in [SrcID TempID TemplateName AbbrevSourceName] {
524524
assert ($cols | any { |c| $c == $col })
525525
}
526526
}

tests/test_db_pres2025.nu

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def e [ctx: record] {
4444
def "db-pres2025 list people pres2025 - has expected columns" [] {
4545
let ctx = $in
4646
let cols = (with-env (e $ctx) { genq list people } | columns)
47-
for col in [index RIN Given Surname Sex BirthDate DeathDate] {
47+
for col in [RIN Given Surname Sex BirthDate DeathDate] {
4848
assert ($cols | any { |c| $c == $col })
4949
}
5050
}
@@ -91,13 +91,6 @@ def "db-pres2025 list people pres2025 - Sex values are M or F only" [] {
9191
assert equal ($invalid | length) 0
9292
}
9393

94-
@test
95-
def "db-pres2025 list people pres2025 - index starts at 1" [] {
96-
let ctx = $in
97-
let result = (with-env (e $ctx) { genq list people })
98-
assert equal ($result | first | get index) 1
99-
}
100-
10194
@test
10295
def "db-pres2025 list people pres2025 - RIN values are positive" [] {
10396
let ctx = $in
@@ -201,7 +194,7 @@ def "db-pres2025 list people pres2025 - --with chronologically sorts nested fact
201194
def "db-pres2025 list events pres2025 - has expected columns" [] {
202195
let ctx = $in
203196
let cols = (with-env (e $ctx) { genq list events } | columns)
204-
for col in [index EventID RIN Given Surname Event Description EventDate SortDate LastUpdate] {
197+
for col in [EventID RIN Given Surname Event Description EventDate SortDate LastUpdate] {
205198
assert ($cols | any { |c| $c == $col })
206199
}
207200
}
@@ -238,13 +231,6 @@ def "db-pres2025 list events pres2025 - sort-date-by orders SortDate ascending"
238231
assert equal $sorted ($sorted | sort)
239232
}
240233

241-
@test
242-
def "db-pres2025 list events pres2025 - index starts at 1" [] {
243-
let ctx = $in
244-
let result = (with-env (e $ctx) { genq list events })
245-
assert equal ($result | first | get index) 1
246-
}
247-
248234
# =============================================================================
249235
# genq list families
250236
# =============================================================================
@@ -253,7 +239,7 @@ def "db-pres2025 list events pres2025 - index starts at 1" [] {
253239
def "db-pres2025 list families pres2025 - has expected columns" [] {
254240
let ctx = $in
255241
let cols = (with-env (e $ctx) { genq list families } | columns)
256-
for col in [index FamilyID FatherID FatherGiven FatherSurname MotherID MotherGiven MotherSurname HusbOrder WifeOrder] {
242+
for col in [FamilyID FatherID FatherGiven FatherSurname MotherID MotherGiven MotherSurname HusbOrder WifeOrder] {
257243
assert ($cols | any { |c| $c == $col })
258244
}
259245
}
@@ -303,7 +289,7 @@ def "db-pres2025 list media pres2025 - runs without error" [] {
303289
def "db-pres2025 list presidents pres2025 - has expected columns" [] {
304290
let ctx = $in
305291
let cols = (with-env (e $ctx) { genq list presidents } | columns)
306-
for col in [index RIN Given Surname Event Description EventDate] {
292+
for col in [RIN Given Surname Event Description EventDate] {
307293
assert ($cols | any { |c| $c == $col })
308294
}
309295
}

tests/test_tabulate_trees.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def "db-iiams tabulate trees - returns records" [] {
4747
def "db-iiams tabulate trees - has correct columns" [] {
4848
if (no-db) { return }
4949
let cols = (with-env (ie) { genq tabulate trees } | columns)
50-
for col in [index RIN Given Surname Count] {
50+
for col in [RIN Given Surname Count] {
5151
assert ($cols | any { |c| $c == $col })
5252
}
5353
}
@@ -121,7 +121,7 @@ def "db-iiams tabulate trees --rin 2471 - returns 54 rows" [] {
121121
def "db-iiams tabulate trees --rin - has correct columns" [] {
122122
if (no-db) { return }
123123
let cols = (with-env (ie) { genq tabulate trees --rin 1 } | columns)
124-
for col in [index RIN Given Surname Sex BirthYear DeathYear Ga Gb Degree] {
124+
for col in [RIN Given Surname Sex BirthYear DeathYear Ga Gb Degree] {
125125
assert ($cols | any { |c| $c == $col })
126126
}
127127
}

0 commit comments

Comments
 (0)