diff --git a/integration_test.go b/integration_test.go index 1e325fe..2e5ba56 100644 --- a/integration_test.go +++ b/integration_test.go @@ -75,6 +75,10 @@ func TestIntegration(t *testing.T) { inputDir: filepath.Join("testrunner", "testdata", "practice", "pkg_level_error"), expected: filepath.Join("testrunner", "testdata", "expected", "pkg_level_error.json"), }, + { + inputDir: filepath.Join("testrunner", "testdata", "practice", "separate_cases_file"), + expected: filepath.Join("testrunner", "testdata", "expected", "separate_cases_file.json"), + }, { inputDir: filepath.Join("testrunner", "testdata", "practice", "failing"), expected: filepath.Join("testrunner", "testdata", "expected", "failing.json"), diff --git a/testrunner/extract_test.go b/testrunner/extract_test.go index d877b19..b5be8bd 100644 --- a/testrunner/extract_test.go +++ b/testrunner/extract_test.go @@ -211,8 +211,6 @@ func TestExtractTestCode(t *testing.T) { }`, }, } - tests = append(tests, testsDataSeparate...) - tests = append(tests, testsMultiAssignStmt...) for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { code, _ := ExtractTestCodeAndTaskID(rootLevelTestsMap, tt.testName) @@ -243,108 +241,3 @@ func TestExtractTestCode(t *testing.T) { }) } } - -var testsDataSeparate = []struct { - name string - testName string - testFile string - code string -}{ - { - name: "working subtest with separate test data", - testName: "TestParseCard_Separate/parse_jack", - testFile: filepath.Join("testdata", "concept", "conditionals", "conditionals_test.go"), - code: `func TestParseCard_Separate(t *testing.T) { - tt := struct { - name string - card string - want int - }{ - name: "parse jack", - card: "jack", - want: 10, - } - - if got := ParseCard(tt.card); got != tt.want { - t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) - } - -}`, - }, { - name: "missing / not found subtest with separate test data", - testName: "TestParseCard_Separate/parse_missing_subtests", - testFile: filepath.Join("testdata", "concept", "conditionals", "conditionals_test.go"), - code: `func TestParseCard_Separate(t *testing.T) { - for _, tt := range testcases { - t.Run(tt.name, func(t *testing.T) { - if got := ParseCard(tt.card); got != tt.want { - t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) - } - }) - } -}`, - }, { - name: "multiple statements with separate test data", - testName: "TestBlackjack_Separate/blackjack_with_ten_(ace_first)", - testFile: filepath.Join("testdata", "concept", "conditionals", "conditionals_test.go"), - code: `func TestBlackjack_Separate(t *testing.T) { - tt := struct { - name string - hand hand - want bool - }{ - name: "blackjack with ten (ace first)", - hand: hand{card1: "ace", card2: "ten"}, - want: true, - } - someAssignment := "test" - fmt.Println(someAssignment) - - _ = "literally anything" - - got := IsBlackjack(tt.hand.card1, tt.hand.card2) - if got != tt.want { - t.Errorf("IsBlackjack(%s, %s) = %t, want %t", tt.hand.card1, tt.hand.card2, got, tt.want) - } - - // Additional statements should be included - fmt.Println("the whole block") - fmt.Println("should be returned") -}`, - }, -} -var testsMultiAssignStmt = []struct { - name string - testName string - testFile string - code string -}{ - { - name: "subtest with arbitrary test data variable name, additional assign statements above and below test data", - testName: "TestSubtest_MultiAssignStmt/parse_king", - testFile: filepath.Join("testdata", "concept", "conditionals", "conditionals_test.go"), - code: `func TestSubtest_MultiAssignStmt(t *testing.T) { - someAssignment := "test" - - tt := struct { - name string - card string - want int - }{ - name: "parse king", - card: "king", - want: 10, - } - - someAssignment2 := "test2" - - if got := ParseCard(tt.card); got != tt.want { - t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) - } - - // Additional statements should be included - fmt.Println("the whole block") - fmt.Println("should be returned") -}`, - }, -} diff --git a/testrunner/testdata/concept/conditionals/cases_test.go b/testrunner/testdata/concept/conditionals/cases_test.go index 96c45f2..3f7e887 100644 --- a/testrunner/testdata/concept/conditionals/cases_test.go +++ b/testrunner/testdata/concept/conditionals/cases_test.go @@ -19,62 +19,3 @@ var allergicToTests = []struct { expected: false, }, } -var testcases = []struct { - name string - card string - want int -}{ - { - name: "parse two", - card: "two", - want: 2, - }, - { - name: "parse jack", - card: "jack", - want: 10, - }, - { - name: "parse king", - card: "king", - want: 10, - }, -} - -type hand struct { - card1, card2 string -} - -var testcases2 = []struct { - name string - hand hand - want bool -}{ - { - name: "blackjack with ten (ace first)", - hand: hand{card1: "ace", card2: "ten"}, - want: true, - }, - { - name: "blackjack with jack (ace first)", - hand: hand{card1: "ace", card2: "jack"}, - want: true, - }, - { - name: "blackjack with queen (ace first)", - hand: hand{ - card1: "ace", card2: "queen" - }, - want: true, - }, - { - name: "blackjack with king (ace first)", - hand: hand{card1: "ace", card2: "king"}, - want: true, - }, - { - name: "no blackjack with eight and five", - hand: hand{card2: "eight", card1: "five"}, - want: false, - }, -} diff --git a/testrunner/testdata/concept/conditionals/conditionals_test.go b/testrunner/testdata/concept/conditionals/conditionals_test.go index 4bb3e87..6d11143 100644 --- a/testrunner/testdata/concept/conditionals/conditionals_test.go +++ b/testrunner/testdata/concept/conditionals/conditionals_test.go @@ -143,71 +143,3 @@ func TestBlackjack(t *testing.T) { fmt.Println("the whole block") fmt.Println("should be returned") } -func TestParseCard_Separate(t *testing.T) { - for _, tt := range testcases { - t.Run(tt.name, func(t *testing.T) { - if got := ParseCard(tt.card); got != tt.want { - t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) - } - }) - } -} - -func TestBlackjack_Separate(t *testing.T) { - someAssignment := "test" - fmt.Println(someAssignment) - - _ = "literally anything" - - for _, tt := range testcases2 { - t.Run(tt.name, func(t *testing.T) { - got := IsBlackjack(tt.hand.card1, tt.hand.card2) - if got != tt.want { - t.Errorf("IsBlackjack(%s, %s) = %t, want %t", tt.hand.card1, tt.hand.card2, got, tt.want) - } - }) - } - - // Additional statements should be included - fmt.Println("the whole block") - fmt.Println("should be returned") -} -func TestSubtest_MultiAssignStmt(t *testing.T) { - someAssignment := "test" - - myTests := []struct { - name string - card string - want int - }{ - { - name: "parse two", - card: "two", - want: 2, - }, - { - name: "parse jack", - card: "jack", - want: 10, - }, - { - name: "parse king", - card: "king", - want: 10, - }, - } - - someAssignment2 := "test2" - - for _, tt := range myTests { - t.Run(tt.name, func(t *testing.T) { - if got := ParseCard(tt.card); got != tt.want { - t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) - } - }) - } - - // Additional statements should be included - fmt.Println("the whole block") - fmt.Println("should be returned") -} diff --git a/testrunner/testdata/expected/separate_cases_file.json b/testrunner/testdata/expected/separate_cases_file.json new file mode 100644 index 0000000..7168b46 --- /dev/null +++ b/testrunner/testdata/expected/separate_cases_file.json @@ -0,0 +1,72 @@ +{ + "status": "pass", + "version": 3, + "tests": [ + { + "name": "TestParseCard Separate/ parse two", + "status": "pass", + "test_code": "func TestParseCard_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse two\",\n\t\tcard: \"two\",\n\t\twant: 2,\n\t}\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n}", + "message": "\n=== RUN TestParseCard_Separate/parse_two\n\n--- PASS: TestParseCard_Separate/parse_two \n" + }, + { + "name": "TestParseCard Separate/ parse jack", + "status": "pass", + "test_code": "func TestParseCard_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse jack\",\n\t\tcard: \"jack\",\n\t\twant: 10,\n\t}\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n}", + "message": "\n=== RUN TestParseCard_Separate/parse_jack\n\n--- PASS: TestParseCard_Separate/parse_jack \n" + }, + { + "name": "TestParseCard Separate/ parse king", + "status": "pass", + "test_code": "func TestParseCard_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse king\",\n\t\tcard: \"king\",\n\t\twant: 10,\n\t}\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n}", + "message": "\n=== RUN TestParseCard_Separate/parse_king\n\n--- PASS: TestParseCard_Separate/parse_king \n" + }, + { + "name": "TestBlackjack Separate/ blackjack with ten (ace first)", + "status": "pass", + "test_code": "func TestBlackjack_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\thand hand\n\t\twant bool\n\t}{\n\t\tname: \"blackjack with ten (ace first)\",\n\t\thand: hand{card1: \"ace\", card2: \"ten\"},\n\t\twant: true,\n\t}\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\t_ = \"literally anything\"\n\n\tgot := IsBlackjack(tt.hand.card1, tt.hand.card2)\n\tif got != tt.want {\n\t\tt.Errorf(\"IsBlackjack(%s, %s) = %t, want %t\", tt.hand.card1, tt.hand.card2, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestBlackjack_Separate/blackjack_with_ten_(ace_first)\n\n--- PASS: TestBlackjack_Separate/blackjack_with_ten_(ace_first) \n" + }, + { + "name": "TestBlackjack Separate/ blackjack with jack (ace first)", + "status": "pass", + "test_code": "func TestBlackjack_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\thand hand\n\t\twant bool\n\t}{\n\t\tname: \"blackjack with jack (ace first)\",\n\t\thand: hand{card1: \"ace\", card2: \"jack\"},\n\t\twant: true,\n\t}\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\t_ = \"literally anything\"\n\n\tgot := IsBlackjack(tt.hand.card1, tt.hand.card2)\n\tif got != tt.want {\n\t\tt.Errorf(\"IsBlackjack(%s, %s) = %t, want %t\", tt.hand.card1, tt.hand.card2, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestBlackjack_Separate/blackjack_with_jack_(ace_first)\n\n--- PASS: TestBlackjack_Separate/blackjack_with_jack_(ace_first) \n" + }, + { + "name": "TestBlackjack Separate/ blackjack with queen (ace first)", + "status": "pass", + "test_code": "func TestBlackjack_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\thand hand\n\t\twant bool\n\t}{\n\t\tname: \"blackjack with queen (ace first)\",\n\t\thand: hand{\n\t\t\tcard1: \"ace\", card2: \"queen\",\n\t\t},\n\t\twant: true,\n\t}\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\t_ = \"literally anything\"\n\n\tgot := IsBlackjack(tt.hand.card1, tt.hand.card2)\n\tif got != tt.want {\n\t\tt.Errorf(\"IsBlackjack(%s, %s) = %t, want %t\", tt.hand.card1, tt.hand.card2, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestBlackjack_Separate/blackjack_with_queen_(ace_first)\n\n--- PASS: TestBlackjack_Separate/blackjack_with_queen_(ace_first) \n" + }, + { + "name": "TestBlackjack Separate/ blackjack with king (ace first)", + "status": "pass", + "test_code": "func TestBlackjack_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\thand hand\n\t\twant bool\n\t}{\n\t\tname: \"blackjack with king (ace first)\",\n\t\thand: hand{card1: \"ace\", card2: \"king\"},\n\t\twant: true,\n\t}\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\t_ = \"literally anything\"\n\n\tgot := IsBlackjack(tt.hand.card1, tt.hand.card2)\n\tif got != tt.want {\n\t\tt.Errorf(\"IsBlackjack(%s, %s) = %t, want %t\", tt.hand.card1, tt.hand.card2, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestBlackjack_Separate/blackjack_with_king_(ace_first)\n\n--- PASS: TestBlackjack_Separate/blackjack_with_king_(ace_first) \n" + }, + { + "name": "TestBlackjack Separate/ no blackjack with eight and five", + "status": "pass", + "test_code": "func TestBlackjack_Separate(t *testing.T) {\n\ttt := struct {\n\t\tname string\n\t\thand hand\n\t\twant bool\n\t}{\n\t\tname: \"no blackjack with eight and five\",\n\t\thand: hand{card2: \"eight\", card1: \"five\"},\n\t\twant: false,\n\t}\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\t_ = \"literally anything\"\n\n\tgot := IsBlackjack(tt.hand.card1, tt.hand.card2)\n\tif got != tt.want {\n\t\tt.Errorf(\"IsBlackjack(%s, %s) = %t, want %t\", tt.hand.card1, tt.hand.card2, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestBlackjack_Separate/no_blackjack_with_eight_and_five\n\n--- PASS: TestBlackjack_Separate/no_blackjack_with_eight_and_five \n" + }, + { + "name": "TestSubtest MultiAssignStmt/ parse two", + "status": "pass", + "test_code": "func TestSubtest_MultiAssignStmt(t *testing.T) {\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse two\",\n\t\tcard: \"two\",\n\t\twant: 2,\n\t}\n\n\tsomeAssignment2 := \"test2\"\n\tfmt.Println(someAssignment2)\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestSubtest_MultiAssignStmt/parse_two\n\n--- PASS: TestSubtest_MultiAssignStmt/parse_two \n" + }, + { + "name": "TestSubtest MultiAssignStmt/ parse jack", + "status": "pass", + "test_code": "func TestSubtest_MultiAssignStmt(t *testing.T) {\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse jack\",\n\t\tcard: \"jack\",\n\t\twant: 10,\n\t}\n\n\tsomeAssignment2 := \"test2\"\n\tfmt.Println(someAssignment2)\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestSubtest_MultiAssignStmt/parse_jack\n\n--- PASS: TestSubtest_MultiAssignStmt/parse_jack \n" + }, + { + "name": "TestSubtest MultiAssignStmt/ parse king", + "status": "pass", + "test_code": "func TestSubtest_MultiAssignStmt(t *testing.T) {\n\tsomeAssignment := \"test\"\n\tfmt.Println(someAssignment)\n\n\ttt := struct {\n\t\tname string\n\t\tcard string\n\t\twant int\n\t}{\n\t\tname: \"parse king\",\n\t\tcard: \"king\",\n\t\twant: 10,\n\t}\n\n\tsomeAssignment2 := \"test2\"\n\tfmt.Println(someAssignment2)\n\n\tif got := ParseCard(tt.card); got != tt.want {\n\t\tt.Errorf(\"ParseCard(%s) = %d, want %d\", tt.card, got, tt.want)\n\t}\n\n\t// Additional statements should be included\n\tfmt.Println(\"the whole block\")\n\tfmt.Println(\"should be returned\")\n}", + "message": "\n=== RUN TestSubtest_MultiAssignStmt/parse_king\n\n--- PASS: TestSubtest_MultiAssignStmt/parse_king \n" + } + ] +} \ No newline at end of file diff --git a/testrunner/testdata/practice/separate_cases_file/.meta/config.json b/testrunner/testdata/practice/separate_cases_file/.meta/config.json new file mode 100644 index 0000000..39dcd6d --- /dev/null +++ b/testrunner/testdata/practice/separate_cases_file/.meta/config.json @@ -0,0 +1,23 @@ +{ + "blurb": "...", + "authors": [ + "..." + ], + "contributors": [ + "..." + ], + "files": { + "solution": [ + "conditionals.go" + ], + "test": [ + "conditionals_test.go" + ], + "example": [ + ".meta/example.go" + ] + }, + "custom": { + "taskIdsEnabled": false + } +} diff --git a/testrunner/testdata/practice/separate_cases_file/cases_test.go b/testrunner/testdata/practice/separate_cases_file/cases_test.go new file mode 100644 index 0000000..cd63f29 --- /dev/null +++ b/testrunner/testdata/practice/separate_cases_file/cases_test.go @@ -0,0 +1,61 @@ +package conditionals + +var testcases = []struct { + name string + card string + want int +}{ + { + name: "parse two", + card: "two", + want: 2, + }, + { + name: "parse jack", + card: "jack", + want: 10, + }, + { + name: "parse king", + card: "king", + want: 10, + }, +} + +type hand struct { + card1, card2 string +} + +var testcases2 = []struct { + name string + hand hand + want bool +}{ + { + name: "blackjack with ten (ace first)", + hand: hand{card1: "ace", card2: "ten"}, + want: true, + }, + { + name: "blackjack with jack (ace first)", + hand: hand{card1: "ace", card2: "jack"}, + want: true, + }, + { + name: "blackjack with queen (ace first)", + hand: hand{ + card1: "ace", card2: "queen", + }, + want: true, + }, + { + name: "blackjack with king (ace first)", + hand: hand{card1: "ace", card2: "king"}, + want: true, + }, + { + name: "no blackjack with eight and five", + hand: hand{card2: "eight", card1: "five"}, + want: false, + }, +} diff --git a/testrunner/testdata/practice/separate_cases_file/conditionals.go b/testrunner/testdata/practice/separate_cases_file/conditionals.go new file mode 100644 index 0000000..2cc28c9 --- /dev/null +++ b/testrunner/testdata/practice/separate_cases_file/conditionals.go @@ -0,0 +1,59 @@ +package conditionals + +// ParseCard returns the integer value of a card following blackjack ruleset. +func ParseCard(card string) int { + val := 0 + switch card { + case "ace": + val = 11 + case "ten", "jack", "queen", "king": + val = 10 + case "one": + val = 1 + case "two": + val = 2 + case "three": + val = 3 + case "four": + val = 4 + case "five": + val = 5 + case "six": + val = 6 + case "seven": + val = 7 + case "eight": + val = 8 + case "nine": + val = 9 + } + return val +} + +// IsBlackjack returns true if the player has a blackjack, false otherwise. +func IsBlackjack(card1, card2 string) bool { + return ParseCard(card1)+ParseCard(card2) == 21 +} + +// LargeHand implements the decision tree for hand scores larger than 20 points. +func LargeHand(isBlackjack bool, dealerScore int) string { + panic("Please implement the LargeHand function") +} + +// SmallHand implements the decision tree for hand scores with less than 21 points. +func SmallHand(handScore int, dealerScore int) string { + panic("Please implement the SmallHand function") +} + +// FirstTurn returns the semi-optimal decision for the first turn, given the cards of the player and the dealer. +// This function is already implemented and does not need to be edited. It pulls the other functions together in a +// complete decision tree for the first turn. +func FirstTurn(card1, card2, dealerCard string) string { + handScore := ParseCard(card1) + ParseCard(card2) + dealerScore := ParseCard(dealerCard) + + if 20 < handScore { + return LargeHand(IsBlackjack(card1, card2), dealerScore) + } + return SmallHand(handScore, dealerScore) +} diff --git a/testrunner/testdata/practice/separate_cases_file/conditionals_test.go b/testrunner/testdata/practice/separate_cases_file/conditionals_test.go new file mode 100644 index 0000000..4fb2474 --- /dev/null +++ b/testrunner/testdata/practice/separate_cases_file/conditionals_test.go @@ -0,0 +1,77 @@ +package conditionals + +import ( + "fmt" + "testing" +) + +func TestParseCard_Separate(t *testing.T) { + for _, tt := range testcases { + t.Run(tt.name, func(t *testing.T) { + if got := ParseCard(tt.card); got != tt.want { + t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) + } + }) + } +} + +func TestBlackjack_Separate(t *testing.T) { + someAssignment := "test" + fmt.Println(someAssignment) + + _ = "literally anything" + + for _, tt := range testcases2 { + t.Run(tt.name, func(t *testing.T) { + got := IsBlackjack(tt.hand.card1, tt.hand.card2) + if got != tt.want { + t.Errorf("IsBlackjack(%s, %s) = %t, want %t", tt.hand.card1, tt.hand.card2, got, tt.want) + } + }) + } + + // Additional statements should be included + fmt.Println("the whole block") + fmt.Println("should be returned") +} +func TestSubtest_MultiAssignStmt(t *testing.T) { + someAssignment := "test" + fmt.Println(someAssignment) + + myTests := []struct { + name string + card string + want int + }{ + { + name: "parse two", + card: "two", + want: 2, + }, + { + name: "parse jack", + card: "jack", + want: 10, + }, + { + name: "parse king", + card: "king", + want: 10, + }, + } + + someAssignment2 := "test2" + fmt.Println(someAssignment2) + + for _, tt := range myTests { + t.Run(tt.name, func(t *testing.T) { + if got := ParseCard(tt.card); got != tt.want { + t.Errorf("ParseCard(%s) = %d, want %d", tt.card, got, tt.want) + } + }) + } + + // Additional statements should be included + fmt.Println("the whole block") + fmt.Println("should be returned") +} diff --git a/testrunner/testdata/practice/separate_cases_file/go.mod b/testrunner/testdata/practice/separate_cases_file/go.mod new file mode 100644 index 0000000..ceac322 --- /dev/null +++ b/testrunner/testdata/practice/separate_cases_file/go.mod @@ -0,0 +1,3 @@ +module conditionals + +go 1.18