refactored tests based on test-file.txt; this file is no more needed

This commit is contained in:
2026-07-30 16:11:17 +02:00
parent e896e06a93
commit 8084ffbc19
5 changed files with 93 additions and 53 deletions
+1 -4
View File
@@ -130,8 +130,6 @@ func TestFilterIterator(t *testing.T) {
inputs := []inputType{
/* 1 */ {`$$([1,2,3] filter $_%2==0)`, list.NewLinkedListA(2), nil},
/* 2 */ {`it = [1,2,3] filter $_%2!=1; $$(it)`, list.NewLinkedListA(2), nil},
/* 3 */ {`builtin "os.file"; #$$(fileLineIterator("test-file.txt") filter (#${_} == 2))`, int64(0), nil},
/* 4 */ {`builtin "os.file"; #$$(fileLineIterator("test-file.txt") filter (#${_} == 3))`, int64(2), nil},
}
// runTestSuiteSpec(t, section, inputs, 2)
@@ -171,8 +169,7 @@ func TestMapIterator(t *testing.T) {
/* 1 */ {`$$([3,4,5] map ${_#})`, list.NewLinkedListA(1, 2, 3), nil},
/* 2 */ {`#$$($(..10) map ${_})`, int64(10), nil},
/* 3 */ {`#$$($(10..0) map ${_})`, int64(10), nil},
/* 4 */ {`builtin "os.file"; $$(fileLineIterator("test-file.txt") map ${__})`, list.NewLinkedListA(0, 1), nil},
/* 5 */ {`$$(["1", "2", "3"] map int())`, nil, `int(): too few params -- expected 1, got 0`},
/* 4 */ {`$$(["1", "2", "3"] map int())`, nil, `int(): too few params -- expected 1, got 0`},
}
// runTestSuiteSpec(t, section, inputs, 2)