From db81f78e12b2918c6c755ef9f762f2dc4e68a132 Mon Sep 17 00:00:00 2001 From: domi41 Date: Tue, 8 Sep 2020 15:51:13 +0200 Subject: [PATCH] fix(tests): restore the order of signal parameters --- addons/majority_judgment/MajorityJudgmentParticipant.gd | 4 ++-- .../nodes/MajorityJudgmentLinearResultsControl.gd | 2 +- .../providers/MajorityJudgmentAbstractJudgmentsProvider.gd | 4 ++-- .../MajorityJudgmentChatCommandJudgmentsProvider.gd | 6 +++--- tests/main.test.gd | 2 -- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/majority_judgment/MajorityJudgmentParticipant.gd b/addons/majority_judgment/MajorityJudgmentParticipant.gd index 90d3bef..93c20b5 100644 --- a/addons/majority_judgment/MajorityJudgmentParticipant.gd +++ b/addons/majority_judgment/MajorityJudgmentParticipant.gd @@ -18,8 +18,8 @@ static func make(__name): func set_name(__name:String) -> void: var invalid = RegEx.new() - invalid.compile("[^a-zA-Z0-9+._-]+") - __name = invalid.sub(__name, '', true) +# invalid.compile("[^a-zA-Z0-9+._-]+") +# __name = invalid.sub(__name, '', true) __name = __name.substr(0, min(__name.length(), 20)) if "" == __name: printerr("Participant name is empty!") diff --git a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd index 56fbd3b..ee2031e 100644 --- a/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd +++ b/addons/majority_judgment/nodes/MajorityJudgmentLinearResultsControl.gd @@ -231,7 +231,7 @@ func get_or_create_participant(identifier:String) -> MajorityJudgmentParticipant var __save_mutex := Mutex.new() # perhaps overzealous -func __on_judgment_emitted(author_identifier, grade_index, candidate_index): +func __on_judgment_emitted(author_identifier, candidate_index, grade_index): # Data comes from userland, best be extra careful in here if ( grade_index < 0 diff --git a/addons/majority_judgment/providers/MajorityJudgmentAbstractJudgmentsProvider.gd b/addons/majority_judgment/providers/MajorityJudgmentAbstractJudgmentsProvider.gd index 1e910dc..64c0fb9 100644 --- a/addons/majority_judgment/providers/MajorityJudgmentAbstractJudgmentsProvider.gd +++ b/addons/majority_judgment/providers/MajorityJudgmentAbstractJudgmentsProvider.gd @@ -25,8 +25,8 @@ class_name MajorityJudgmentAbstractJudgmentsProvider signal judgment_emitted( author_identifier, # String, unique per author (aka participant) - grade_index, # int (0 == REJECT, up to the grading size minus one) - candidate_index # int, position in the original array of candidates + candidate_index, # int, position in the original array of candidates + grade_index # int (0 == REJECT, up to the grading size minus one) ) diff --git a/addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd b/addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd index 00be4d7..f1ae235 100644 --- a/addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd +++ b/addons/majority_judgment/providers/MajorityJudgmentChatCommandJudgmentsProvider.gd @@ -35,7 +35,7 @@ class_name MajorityJudgmentChatCommandJudgmentsProvider func process_chat_command(author_identifier:String, chat_command:String): var regex = RegEx.new() - regex.compile("(?[a-zA-Z]{1,2})(?[0-9]{1,2})") + regex.compile("(?[a-zA-Z]{1})(?[0-9]{1})") var results = regex.search_all(chat_command) if results: @@ -49,6 +49,6 @@ func process_chat_command(author_identifier:String, chat_command:String): emit_signal( "judgment_emitted", author_identifier, - grade_index, - candidate_index + candidate_index, + grade_index ) diff --git a/tests/main.test.gd b/tests/main.test.gd index 40a7d3d..58d18fe 100644 --- a/tests/main.test.gd +++ b/tests/main.test.gd @@ -86,7 +86,6 @@ func test_common_usage(): asserts.is_equal(poll_tally.candidates_tallies[0].position, 1, "Rantanplan is number one") - var saved_tally = ResourceSaver.save('res://test_poll_tally.tres', poll_tally) asserts.is_equal(saved_tally, OK, "Save Poll Tally to file") @@ -105,4 +104,3 @@ func test_common_usage(): asserts.is_class_instance(loaded_poll.candidates[0], MajorityJudgmentCandidate, "Loaded poll has correct candidates") asserts.is_equal(loaded_poll.candidates[1].name, 'Rantanplan', "Loaded poll has correct candidates names") -