From a18f75c1d2034696f3e678bb5668717bd9b5ab10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Fertyk?= Date: Fri, 17 May 2024 20:56:55 +0200 Subject: [PATCH] Swap actual and expected values in tests [no important files changed] --- exercises/practice/darts/darts_test.gd | 26 ++++++------ .../practice/hello-world/hello_world_test.gd | 2 +- exercises/practice/leap/leap_test.gd | 18 ++++---- exercises/practice/pangram/pangram_test.gd | 20 ++++----- .../resistor_color_duo_test.gd | 14 +++---- .../resistor_color_expert_test.gd | 20 ++++----- .../resistor_color_trio_test.gd | 20 ++++----- .../resistor-color/resistor_color_test.gd | 8 ++-- .../reverse-string/reverse_string_test.gd | 12 +++--- .../robot-simulator/robot_simulator_test.gd | 36 ++++++++-------- .../practice/space-age/space_age_test.gd | 16 +++---- exercises/practice/triangle/triangle_test.gd | 42 +++++++++---------- 12 files changed, 117 insertions(+), 117 deletions(-) diff --git a/exercises/practice/darts/darts_test.gd b/exercises/practice/darts/darts_test.gd index 39e9ba1..737378d 100644 --- a/exercises/practice/darts/darts_test.gd +++ b/exercises/practice/darts/darts_test.gd @@ -2,88 +2,88 @@ func test_missed_target(solution_script): var x = -9 var y = 9 var expected = 0 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_on_the_outer_circle(solution_script): var x = 0 var y = 10 var expected = 1 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_on_the_middle_circle(solution_script): var x = -5 var y = 0 var expected = 5 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_on_the_inner_circle(solution_script): var x = 0 var y = -1 var expected = 10 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_exactly_on_center(solution_script): var x = 0 var y = 0 var expected = 10 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_near_the_center(solution_script): var x = -0.1 var y = -0.1 var expected = 10 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_within_the_inner_circle(solution_script): var x = 0.7 var y = 0.7 var expected = 10 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_outside_the_inner_circle(solution_script): var x = 0.8 var y = -0.8 var expected = 5 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_within_the_middle_circle(solution_script): var x = -3.5 var y = 3.5 var expected = 5 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_outside_the_middle_circle(solution_script): var x = -3.6 var y = -3.6 var expected = 1 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_within_the_outer_circle(solution_script): var x = -7.0 var y = 7.0 var expected = 1 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_just_outside_the_outer_circle(solution_script): var x = 7.1 var y = -7.1 var expected = 0 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] func test_asymmetric_position(solution_script): var x = 0.5 var y = -4 var expected = 5 - return [expected, solution_script.score(x, y)] + return [solution_script.score(x, y), expected] diff --git a/exercises/practice/hello-world/hello_world_test.gd b/exercises/practice/hello-world/hello_world_test.gd index 5655ada..0950165 100644 --- a/exercises/practice/hello-world/hello_world_test.gd +++ b/exercises/practice/hello-world/hello_world_test.gd @@ -1,2 +1,2 @@ func test_hello_world(solution_script): - return ["Hello, World!", solution_script.hello()] + return [solution_script.hello(), "Hello, World!"] diff --git a/exercises/practice/leap/leap_test.gd b/exercises/practice/leap/leap_test.gd index 8463fdd..666f8eb 100644 --- a/exercises/practice/leap/leap_test.gd +++ b/exercises/practice/leap/leap_test.gd @@ -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] diff --git a/exercises/practice/pangram/pangram_test.gd b/exercises/practice/pangram/pangram_test.gd index 338b742..26ad170 100644 --- a/exercises/practice/pangram/pangram_test.gd +++ b/exercises/practice/pangram/pangram_test.gd @@ -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] diff --git a/exercises/practice/resistor-color-duo/resistor_color_duo_test.gd b/exercises/practice/resistor-color-duo/resistor_color_duo_test.gd index 938f4b1..f1f7190 100644 --- a/exercises/practice/resistor-color-duo/resistor_color_duo_test.gd +++ b/exercises/practice/resistor-color-duo/resistor_color_duo_test.gd @@ -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] diff --git a/exercises/practice/resistor-color-expert/resistor_color_expert_test.gd b/exercises/practice/resistor-color-expert/resistor_color_expert_test.gd index 689567d..0c4d2ab 100644 --- a/exercises/practice/resistor-color-expert/resistor_color_expert_test.gd +++ b/exercises/practice/resistor-color-expert/resistor_color_expert_test.gd @@ -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] diff --git a/exercises/practice/resistor-color-trio/resistor_color_trio_test.gd b/exercises/practice/resistor-color-trio/resistor_color_trio_test.gd index b4e479e..4e0c180 100644 --- a/exercises/practice/resistor-color-trio/resistor_color_trio_test.gd +++ b/exercises/practice/resistor-color-trio/resistor_color_trio_test.gd @@ -1,59 +1,59 @@ func test_orange_and_orange_and_black(solution_script): var colors = ["orange", "orange", "black"] var expected = "33 ohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_blue_and_grey_and_brown(solution_script): var colors = ["blue", "grey", "brown"] var expected = "680 ohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_red_and_black_and_red(solution_script): var colors = ["red", "black", "red"] var expected = "2 kiloohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_green_and_brown_and_orange(solution_script): var colors = ["green", "brown", "orange"] var expected = "51 kiloohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_yellow_and_violet_and_yellow(solution_script): var colors = ["yellow", "violet", "yellow"] var expected = "470 kiloohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_blue_and_violet_and_blue(solution_script): var colors = ["blue", "violet", "blue"] var expected = "67 megaohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_minimum_possible_value(solution_script): var colors = ["black", "black", "black"] var expected = "0 ohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_maximum_possible_value(solution_script): var colors = ["white", "white", "white"] var expected = "99 gigaohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_first_two_colors_make_an_invalid_octal_number(solution_script): var colors = ["black", "grey", "black"] var expected = "8 ohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] func test_ignore_extra_colors(solution_script): var colors = ["blue", "green", "yellow", "orange"] var expected = "650 kiloohms" - return [expected, solution_script.color_code(colors)] + return [solution_script.color_code(colors), expected] diff --git a/exercises/practice/resistor-color/resistor_color_test.gd b/exercises/practice/resistor-color/resistor_color_test.gd index 787befb..653b6b4 100644 --- a/exercises/practice/resistor-color/resistor_color_test.gd +++ b/exercises/practice/resistor-color/resistor_color_test.gd @@ -1,13 +1,13 @@ func test_color_codes_black(solution_script): - return [0, solution_script.color_code("black")] + return [solution_script.color_code("black"), 0] func test_color_codes_white(solution_script): - return [9, solution_script.color_code("white")] + return [solution_script.color_code("white"), 9] func test_color_codes_orange(solution_script): - return [3, solution_script.color_code("orange")] + return [solution_script.color_code("orange"), 3] func test_colors(solution_script): @@ -23,4 +23,4 @@ func test_colors(solution_script): "grey", "white" ] - return [colors, solution_script.colors()] + return [solution_script.colors(), colors] diff --git a/exercises/practice/reverse-string/reverse_string_test.gd b/exercises/practice/reverse-string/reverse_string_test.gd index 49f36e6..a5e98a2 100644 --- a/exercises/practice/reverse-string/reverse_string_test.gd +++ b/exercises/practice/reverse-string/reverse_string_test.gd @@ -1,34 +1,34 @@ func test_empty_string(solution_script): var str = "" var expected = "" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] func test_a_word(solution_script): var str = "robot" var expected = "tobor" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] func test_a_capitalized_word(solution_script): var str = "Ramen" var expected = "nemaR" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] func test_a_sentence_with_punctuation(solution_script): var str = "I'm hungry!" var expected = "!yrgnuh m'I" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] func test_a_palindrome(solution_script): var str = "racecar" var expected = "racecar" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] func test_an_even_sized_word(solution_script): var str = "drawer" var expected = "reward" - return [expected, solution_script.reverse(str)] + return [solution_script.reverse(str), expected] diff --git a/exercises/practice/robot-simulator/robot_simulator_test.gd b/exercises/practice/robot-simulator/robot_simulator_test.gd index 5bfda42..980849d 100644 --- a/exercises/practice/robot-simulator/robot_simulator_test.gd +++ b/exercises/practice/robot-simulator/robot_simulator_test.gd @@ -3,7 +3,7 @@ func test_create_robot_at_origin_facing_north(robot): robot.direction = "north" var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "north"] - return [expected, result] + return [result, expected] func test_create_robot_at_negative_position_facing_south(robot): @@ -11,7 +11,7 @@ func test_create_robot_at_negative_position_facing_south(robot): robot.direction = "south" var result = [robot.position, robot.direction] var expected = [Vector2i(-1, -1), "south"] - return [expected, result] + return [result, expected] func test_rotating_clockwise_changes_north_to_east(robot): @@ -20,7 +20,7 @@ func test_rotating_clockwise_changes_north_to_east(robot): robot.move("R") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "east"] - return [expected, result] + return [result, expected] func test_rotating_clockwise_changes_east_to_south(robot): @@ -29,7 +29,7 @@ func test_rotating_clockwise_changes_east_to_south(robot): robot.move("R") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "south"] - return [expected, result] + return [result, expected] func test_rotating_clockwise_changes_south_to_west(robot): @@ -38,7 +38,7 @@ func test_rotating_clockwise_changes_south_to_west(robot): robot.move("R") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "west"] - return [expected, result] + return [result, expected] func test_rotating_clockwise_changes_west_to_north(robot): @@ -47,7 +47,7 @@ func test_rotating_clockwise_changes_west_to_north(robot): robot.move("R") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "north"] - return [expected, result] + return [result, expected] func test_rotating_counterclockwise_changes_north_to_west(robot): @@ -56,7 +56,7 @@ func test_rotating_counterclockwise_changes_north_to_west(robot): robot.move("L") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "west"] - return [expected, result] + return [result, expected] func test_rotating_counterclockwise_changes_west_to_south(robot): @@ -65,7 +65,7 @@ func test_rotating_counterclockwise_changes_west_to_south(robot): robot.move("L") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "south"] - return [expected, result] + return [result, expected] func test_rotating_counterclockwise_changes_south_to_east(robot): @@ -74,7 +74,7 @@ func test_rotating_counterclockwise_changes_south_to_east(robot): robot.move("L") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "east"] - return [expected, result] + return [result, expected] func test_rotating_counterclockwise_changes_east_to_north(robot): @@ -83,7 +83,7 @@ func test_rotating_counterclockwise_changes_east_to_north(robot): robot.move("L") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 0), "north"] - return [expected, result] + return [result, expected] func test_moving_forward_one_facing_north_increments_y(robot): @@ -92,7 +92,7 @@ func test_moving_forward_one_facing_north_increments_y(robot): robot.move("A") var result = [robot.position, robot.direction] var expected = [Vector2i(0, 1), "north"] - return [expected, result] + return [result, expected] func test_moving_forward_one_facing_south_decrements_y(robot): @@ -101,7 +101,7 @@ func test_moving_forward_one_facing_south_decrements_y(robot): robot.move("A") var result = [robot.position, robot.direction] var expected = [Vector2i(0, -1), "south"] - return [expected, result] + return [result, expected] func test_moving_forward_one_facing_east_increments_x(robot): @@ -110,7 +110,7 @@ func test_moving_forward_one_facing_east_increments_x(robot): robot.move("A") var result = [robot.position, robot.direction] var expected = [Vector2i(1, 0), "east"] - return [expected, result] + return [result, expected] func test_moving_forward_one_facing_west_decrements_x(robot): @@ -119,7 +119,7 @@ func test_moving_forward_one_facing_west_decrements_x(robot): robot.move("A") var result = [robot.position, robot.direction] var expected = [Vector2i(-1, 0), "west"] - return [expected, result] + return [result, expected] func test_moving_east_and_north_from_readme(robot): @@ -128,7 +128,7 @@ func test_moving_east_and_north_from_readme(robot): robot.move("RAALAL") var result = [robot.position, robot.direction] var expected = [Vector2i(9, 4), "west"] - return [expected, result] + return [result, expected] func test_moving_west_and_north(robot): @@ -137,7 +137,7 @@ func test_moving_west_and_north(robot): robot.move("LAAARALA") var result = [robot.position, robot.direction] var expected = [Vector2i(-4, 1), "west"] - return [expected, result] + return [result, expected] func test_moving_west_and_south(robot): @@ -146,7 +146,7 @@ func test_moving_west_and_south(robot): robot.move("RRAAAAALA") var result = [robot.position, robot.direction] var expected = [Vector2i(-3, -8), "south"] - return [expected, result] + return [result, expected] func test_moving_east_and_north(robot): @@ -155,4 +155,4 @@ func test_moving_east_and_north(robot): robot.move("LAAARRRALLLL") var result = [robot.position, robot.direction] var expected = [Vector2i(11, 5), "north"] - return [expected, result] + return [result, expected] diff --git a/exercises/practice/space-age/space_age_test.gd b/exercises/practice/space-age/space_age_test.gd index cfc2645..0f445b5 100644 --- a/exercises/practice/space-age/space_age_test.gd +++ b/exercises/practice/space-age/space_age_test.gd @@ -5,46 +5,46 @@ func roughly_equal(n1, n2): func test_age_on_Earth(solution_script): var age = solution_script.on_planet('Earth', 1000000000) var expected = 31.69 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Mercury(solution_script): var age = solution_script.on_planet('Mercury', 2134835688) var expected = 280.88 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Venus(solution_script): var age = solution_script.on_planet('Venus', 189839836) var expected = 9.78 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Mars(solution_script): var age = solution_script.on_planet('Mars', 2129871239) var expected = 35.88 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Jupiter(solution_script): var age = solution_script.on_planet('Jupiter', 901876382) var expected = 2.41 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Saturn(solution_script): var age = solution_script.on_planet('Saturn', 2000000000) var expected = 2.15 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Uranus(solution_script): var age = solution_script.on_planet('Uranus', 1210123456) var expected = 0.46 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] func test_age_on_Neptune(solution_script): var age = solution_script.on_planet('Neptune', 1821023456) var expected = 0.35 - return [true, roughly_equal(age, expected)] + return [roughly_equal(age, expected), true] diff --git a/exercises/practice/triangle/triangle_test.gd b/exercises/practice/triangle/triangle_test.gd index 64cb484..71045b4 100644 --- a/exercises/practice/triangle/triangle_test.gd +++ b/exercises/practice/triangle/triangle_test.gd @@ -3,31 +3,31 @@ func test_equilateral_all_sides_are_equal(solution_script): var args = [2, 2, 2] var expected = true - return [expected, solution_script.is_equilateral(args)] + return [solution_script.is_equilateral(args), expected] func test_equilateral_any_side_is_unequal(solution_script): var args = [2, 3, 2] var expected = false - return [expected, solution_script.is_equilateral(args)] + return [solution_script.is_equilateral(args), expected] func test_equilateral_no_sides_are_equal(solution_script): var args = [5, 4, 6] var expected = false - return [expected, solution_script.is_equilateral(args)] + return [solution_script.is_equilateral(args), expected] func test_equilateral_all_zero_sides(solution_script): var args = [0, 0, 0] var expected = false - return [expected, solution_script.is_equilateral(args)] + return [solution_script.is_equilateral(args), expected] func test_equilateral_sides_may_be_floats(solution_script): var args = [0.5, 0.5, 0.5] var expected = true - return [expected, solution_script.is_equilateral(args)] + return [solution_script.is_equilateral(args), expected] ## Isosceles triangle tests @@ -36,55 +36,55 @@ func test_equilateral_sides_may_be_floats(solution_script): func test_isosceles_last_two_equal(solution_script): var args = [3, 4, 4] var expected = true - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_first_two_equal(solution_script): var args = [4, 4, 3] var expected = true - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_first_and_last_equal(solution_script): var args = [4, 3, 4] var expected = true - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_can_be_equilateral(solution_script): var args = [4, 4, 4] var expected = true - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_no_sides_equal(solution_script): var args = [2, 3, 4] var expected = false - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_first_inequality_violation(solution_script): var args = [1, 1, 3] var expected = false - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_second_inequality_violation(solution_script): var args = [1, 3, 1] var expected = false - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_third_inequality_violation(solution_script): var args = [3, 1, 1] var expected = false - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] func test_isosceles_sides_may_be_floats(solution_script): var args = [0.5, 0.4, 0.5] var expected = true - return [expected, solution_script.is_isosceles(args)] + return [solution_script.is_isosceles(args), expected] # Scalene triangle tests @@ -93,40 +93,40 @@ func test_isosceles_sides_may_be_floats(solution_script): func test_scalene_no_sides_equal(solution_script): var args = [5, 4, 6] var expected = true - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_all_sides_equal(solution_script): var args = [4, 4, 4] var expected = false - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_first_and_second_equal(solution_script): var args = [4, 4, 3] var expected = false - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_first_and_third_equal(solution_script): var args = [3, 4, 3] var expected = false - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_second_and_third_equal(solution_script): var args = [4, 3, 3] var expected = false - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_inequality_violation(solution_script): var args = [7, 3, 2] var expected = false - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected] func test_scalene_may_be_floats(solution_script): var args = [0.5, 0.4, 0.6] var expected = true - return [expected, solution_script.is_scalene(args)] + return [solution_script.is_scalene(args), expected]