-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swap actual and expected values in tests
- Loading branch information
Showing
12 changed files
with
117 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
func test_hello_world(solution_script): | ||
return ["Hello, World!", solution_script.hello()] | ||
return [solution_script.hello(), "Hello, World!"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
func test_year_not_divisible_by_4(solution_script): | ||
return [false, solution_script.leap(2015)] | ||
return [solution_script.leap(2015), false] | ||
|
||
|
||
func test_year_divisible_by_2_not_4(solution_script): | ||
return [false, solution_script.leap(1970)] | ||
return [solution_script.leap(1970), false] | ||
|
||
|
||
func test_year_divisible_by_4_not_100(solution_script): | ||
return [true, solution_script.leap(1996)] | ||
return [solution_script.leap(1996), true] | ||
|
||
|
||
func test_year_divisible_by_4_and_5(solution_script): | ||
return [true, solution_script.leap(1960)] | ||
return [solution_script.leap(1960), true] | ||
|
||
|
||
func test_year_divisible_by_100_not_400(solution_script): | ||
return [false, solution_script.leap(2100)] | ||
return [solution_script.leap(2100), false] | ||
|
||
|
||
func test_year_divisible_by_100_not_3(solution_script): | ||
return [false, solution_script.leap(1900)] | ||
return [solution_script.leap(1900), false] | ||
|
||
|
||
func test_year_divisible_by_400(solution_script): | ||
return [true, solution_script.leap(2000)] | ||
return [solution_script.leap(2000), true] | ||
|
||
|
||
func test_year_divisible_by_400_not_125(solution_script): | ||
return [true, solution_script.leap(2400)] | ||
return [solution_script.leap(2400), true] | ||
|
||
|
||
func test_year_divisible_by_200_not_400(solution_script): | ||
return [false, solution_script.leap(1800)] | ||
return [ solution_script.leap(1800), false] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,57 @@ | ||
func test_empty_sentence(solution_script): | ||
var input = "" | ||
var expected = false | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_perfect_lower_case(solution_script): | ||
var input = "abcdefghijklmnopqrstuvwxyz" | ||
var expected = true | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_the_quick_brown_fox_jumps_over_the_lazy_dog(solution_script): | ||
var input = "the quick brown fox jumps over the lazy dog" | ||
var expected = true | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_missing_the_letter_x(solution_script): | ||
var input = "a quick movement of the enemy will jeopardize five gunboats" | ||
var expected = false | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_missing_the_letter_h(solution_script): | ||
var input = "five boxing wizards jump quickly at it" | ||
var expected = false | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_with_underscores(solution_script): | ||
var input = "the_quick_brown_fox_jumps_over_the_lazy_dog" | ||
var expected = true | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_with_numbers(solution_script): | ||
var input = "the 1 quick brown fox jumps over the 2 lazy dogs" | ||
var expected = true | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
func test_missing_letters_replaced_by_numbers(solution_script): | ||
var input = "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog" | ||
var expected = false | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_mixed_case_and_punctuation(solution_script): | ||
var input = "\"Five quacking Zephyrs jolt my wax bed.\"" | ||
var expected = true | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] | ||
|
||
|
||
func test_case_insensitive(solution_script): | ||
var input = "abcdefghijklm ABCDEFGHIJKLM" | ||
var expected = false | ||
return [expected, solution_script.is_pangram(input)] | ||
return [solution_script.is_pangram(input), expected] |
14 changes: 7 additions & 7 deletions
14
exercises/practice/resistor-color-duo/resistor_color_duo_test.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
func test_brown_and_black(solution_script): | ||
var colors = ["brown", "black"] | ||
var expected = 10 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_blue_and_grey(solution_script): | ||
var colors = ["blue", "grey"] | ||
var expected = 68 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_yellow_and_violet(solution_script): | ||
var colors = ["yellow", "violet"] | ||
var expected = 47 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_white_and_red(solution_script): | ||
var colors = ["white", "red"] | ||
var expected = 92 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_orange_and_orange(solution_script): | ||
var colors = ["orange", "orange"] | ||
var expected = 33 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_ignore_additional_colors(solution_script): | ||
var colors = ["green", "brown", "orange"] | ||
var expected = 51 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_black_and_brown_one_digit(solution_script): | ||
var colors = ["black", "brown"] | ||
var expected = 1 | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] |
20 changes: 10 additions & 10 deletions
20
exercises/practice/resistor-color-expert/resistor_color_expert_test.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
func test_orange_orange_black_and_red(solution_script): | ||
var colors = ["orange", "orange", "black", "red"] | ||
var expected = "33 ohms ±2%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_blue_grey_brown_and_violet(solution_script): | ||
var colors = ["blue", "grey", "brown", "violet"] | ||
var expected = "680 ohms ±0.1%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_red_black_red_and_green(solution_script): | ||
var colors = ["red", "black", "red", "green"] | ||
var expected = "2 kiloohms ±0.5%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_green_brown_orange_and_grey(solution_script): | ||
var colors = ["green", "brown", "orange", "grey"] | ||
var expected = "51 kiloohms ±0.05%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_one_black_band(solution_script): | ||
var colors = ["black"] | ||
var expected = "0 ohms" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_orange_orange_yellow_black_and_brown(solution_script): | ||
var colors = ["orange", "orange", "yellow", "black", "brown"] | ||
var expected = "334 ohms ±1%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_red_green_yellow_yellow_and_brown(solution_script): | ||
var colors = ["red", "green", "yellow", "yellow", "brown"] | ||
var expected = "2.54 megaohms ±1%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_blue_grey_white_red_and_brown(solution_script): | ||
var colors = ["blue", "grey", "white", "brown", "brown"] | ||
var expected = "6.89 kiloohms ±1%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_violet_orange_red_and_grey(solution_script): | ||
var colors = ["violet", "orange", "red", "grey"] | ||
var expected = "7.3 kiloohms ±0.05%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
||
|
||
func test_brown_red_orange_green_and_blue(solution_script): | ||
var colors = ["brown", "red", "orange", "green", "blue"] | ||
var expected = "12.3 megaohms ±0.25%" | ||
return [expected, solution_script.color_code(colors)] | ||
return [solution_script.color_code(colors), expected] | ||
|
Oops, something went wrong.