From 7c34ae7cccbf3413e0c1f336145c9d58c77a7d75 Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Sun, 18 Oct 2020 22:21:00 -0400 Subject: [PATCH] Bad test proj --- test_proj/Gut.tscn | 28 ---------------------------- test_proj/tests/test_error.gd | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 test_proj/tests/test_error.gd diff --git a/test_proj/Gut.tscn b/test_proj/Gut.tscn index 9d8c3c5..bcb1b3d 100644 --- a/test_proj/Gut.tscn +++ b/test_proj/Gut.tscn @@ -7,34 +7,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 rect_min_size = Vector2( 740, 250 ) script = ExtResource( 1 ) -_font_name = "AnonymousPro" -_font_size = 20 -_font_color = Color( 0.8, 0.8, 0.8, 1 ) -_background_color = Color( 0.15, 0.15, 0.15, 1 ) -_color_output = true -_select_script = "" -_tests_like = "" -_inner_class_name = "" _run_on_load = true -_should_maximize = false -_should_print_to_console = true -_show_orphans = true -_log_level = 1 -_yield_between_tests = true -_disable_strict_datatype_checks = false -_test_prefix = "test_" -_file_prefix = "test_" -_file_extension = ".gd" -_inner_class_prefix = "Test" -_temp_directory = "user://gut_temp_directory" -_export_path = "" _include_subdirectories = true _directory1 = "res://tests" -_directory2 = "" -_directory3 = "" -_directory4 = "" -_directory5 = "" -_directory6 = "" -_double_strategy = 1 -_pre_run_script = "" -_post_run_script = "" diff --git a/test_proj/tests/test_error.gd b/test_proj/tests/test_error.gd new file mode 100644 index 0000000..db86eaa --- /dev/null +++ b/test_proj/tests/test_error.gd @@ -0,0 +1,24 @@ +extends 'res://addons/gut/test.gd' + +var ObjToTest = load('res://obj_to_test.gd') + +func test_this_is_ok(): + var o = ObjToTest.new() + # We've decided it is ok for this method to return null here and that we do + # not care about the script error. + assert_null(o.is_param_the_number_1('a')) + +func test_this_is_NOT_ok(): + var a = 'a' + if(a == 1): # causes test to exit and our asserts are never called + assert_eq(1,1) + else: + assert_eq(1,2) + +func test_this_is_also_NOT_ok(): + assert_eq('1', '1') # this suppresses the warning since we did an assert + var a = 'a' + if(a == 1): # causes test to exit and our asserts are never called + assert_eq(1,1) + else: + assert_eq(1,2)