Skip to content

Commit e19d29d

Browse files
committed
refactor: update test cases in stages_test.go and pass fixture
- Removed outdated stage slugs from the `pass_all` test case to address randomness issues. - Updated the pass fixture to reflect new queries and data for stages #WS9 and #NZ8, enhancing test coverage and accuracy.
1 parent 3790646 commit e19d29d

File tree

2 files changed

+31
-51
lines changed

2 files changed

+31
-51
lines changed

internal/stages_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ func TestStages(t *testing.T) {
5555
},
5656
"pass_all": {
5757
// omitted "dr6", "ce0" because sqlite3 on linux is not compiled to support .dbinfo
58-
StageSlugs: []string{"sz4", "nd9", "az9", "vc9", "rf3", "ws9", "nz8"},
58+
// omitted "az9", "vc9", "rf3" because randomness issues
59+
StageSlugs: []string{"sz4", "nd9", "ws9", "nz8"},
5960
CodePath: "./test_helpers/pass_all",
6061
ExpectedExitCode: 0,
6162
StdoutFixturePath: "./test_helpers/fixtures/base/pass",

internal/test_helpers/fixtures/base/pass

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,62 +12,41 @@ Debug = true
1212
[your_program] 114
1313
[tester::#ND9] Test passed.
1414

15-
[tester::#AZ9] Running tests for Stage #AZ9 (az9)
16-
[tester::#AZ9] Creating test.db with table: apple
17-
[tester::#AZ9] Columns in table: pear, raspberry, grape, orange, pineapple
18-
[tester::#AZ9] $ ./your_sqlite3.sh test.db "select orange from apple"
19-
[your_program] Mckayla
20-
[your_program] Chasity
21-
[your_program] Reyna
22-
[your_program] Erika
23-
[tester::#AZ9] Test passed.
24-
25-
[tester::#VC9] Running tests for Stage #VC9 (vc9)
26-
[tester::#VC9] Creating test.db with table: apple
27-
[tester::#VC9] Columns in table: pear, banana, pineapple, blueberry, grape
28-
[tester::#VC9] $ ./your_sqlite3.sh test.db "select pineapple, banana, blueberry from apple"
29-
[your_program] Leilani|Odie|Althea
30-
[your_program] Krystina|Rebekah|Onie
31-
[your_program] Ellen|Dawn|Karelle
32-
[your_program] Charlene|Mayra|Lilyan
33-
[your_program] Asia|Charity|Dahlia
34-
[your_program] Winifred|Brandyn|Selina
35-
[your_program] Golda|Marcelle|Kacie
36-
[tester::#VC9] Test passed.
37-
38-
[tester::#RF3] Running tests for Stage #RF3 (rf3)
39-
[tester::#RF3] Creating test.db with table: banana
40-
[tester::#RF3] $ ./your_sqlite3.sh test.db "select blueberry, banana, mango from banana where grape = 'Noemie'"
41-
[your_program] Clotilde|Dayna|Grace
42-
[tester::#RF3] Test passed.
43-
4415
[tester::#WS9] Running tests for Stage #WS9 (ws9)
45-
[tester::#WS9] $ ./your_sqlite3.sh test.db "SELECT id, name FROM superheroes WHERE hair_color = 'Violet Hair'"
46-
[your_program] 988|Susan Linden I (New Earth)
47-
[your_program] 1010|Flora Black (New Earth)
48-
[your_program] 1781|Susan Linden II (New Earth)
49-
[your_program] 2560|Gretti (New Earth)
16+
[tester::#WS9] $ ./your_sqlite3.sh test.db "SELECT id, name FROM superheroes WHERE eye_color = 'Gold Eyes'"
17+
[your_program] 764|Azrael (New Earth)
18+
[your_program] 1131|Lambien (New Earth)
19+
[your_program] 1616|Anna Fortune (New Earth)
20+
[your_program] 2995|Layla (New Earth)
21+
[your_program] 4346|Allegra Garcia (New Earth)
22+
[your_program] 4533|Kal-El (DC One Million)
23+
[your_program] 4710|Amber (New Earth)
24+
[your_program] 4765|Ahura-Mazda (New Earth)
25+
[your_program] 5413|Majistra (New Earth)
26+
[tester::#WS9] $ ./your_sqlite3.sh test.db "SELECT id, name FROM superheroes WHERE eye_color = 'Pink Eyes'"
27+
[your_program] 297|Stealth (New Earth)
28+
[your_program] 790|Tobias Whale (New Earth)
29+
[your_program] 1085|Felicity (New Earth)
30+
[your_program] 2729|Thrust (New Earth)
31+
[your_program] 3289|Angora Lapin (New Earth)
32+
[your_program] 3913|Matris Ater Clementia (New Earth)
5033
[tester::#WS9] $ ./your_sqlite3.sh test.db "SELECT id, name FROM superheroes WHERE hair_color = 'Reddish Brown Hair'"
5134
[your_program] 474|Yolanda Montez (New Earth)
5235
[your_program] 3748|Deron Ved (Earth-One)
5336
[your_program] 6777|G'Nort (New Earth)
54-
[tester::#WS9] $ ./your_sqlite3.sh test.db "SELECT id, name FROM superheroes WHERE hair_color = 'Silver Hair'"
55-
[your_program] 252|Dolphin (New Earth)
56-
[your_program] 1052|Silver St. Cloud (New Earth)
57-
[your_program] 2668|Pasquale Galante, Jr. (New Earth)
5837
[tester::#WS9] Test passed.
5938

6039
[tester::#NZ8] Running tests for Stage #NZ8 (nz8)
61-
[tester::#NZ8] $ ./your_sqlite3.sh test.db "SELECT id, name FROM companies WHERE country = 'north korea'"
62-
[your_program] 986681|isn network company limited
63-
[your_program] 1573653|initial innovation limited
64-
[your_program] 2828420|beacon point ltd
65-
[your_program] 3485462|pyongyang university of science & technology (pust)
66-
[your_program] 3969653|plastoform industries ltd
67-
[your_program] 4271599|korea national insurance corporation
68-
[tester::#NZ8] $ ./your_sqlite3.sh test.db "SELECT id, name FROM companies WHERE country = 'eritrea'"
69-
[your_program] 121311|unilink s.c.
70-
[your_program] 2102438|orange asmara it solutions
71-
[your_program] 5729848|zara mining share company
72-
[your_program] 6634629|asmara rental
40+
[tester::#NZ8] $ ./your_sqlite3.sh test.db "SELECT id, name FROM companies WHERE country = 'micronesia'"
41+
[your_program] 1307865|college of micronesia
42+
[your_program] 3696903|nanofabrica
43+
[your_program] 4023193|fsm statistics
44+
[your_program] 6132291|vital energy micronesia
45+
[your_program] 6387751|fsm development bank
46+
[tester::#NZ8] $ ./your_sqlite3.sh test.db "SELECT id, name FROM companies WHERE country = 'tonga'"
47+
[your_program] 361142|tonga communications corporation
48+
[your_program] 3186430|tonga development bank
49+
[your_program] 3583436|leiola group limited
50+
[your_program] 4796634|royco amalgamated company limited
51+
[your_program] 7084593|tonga business enterprise centre
7352
[tester::#NZ8] Test passed.

0 commit comments

Comments
 (0)