Skip to content

Commit

Permalink
fix the division unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Dec 30, 2024
1 parent e9de495 commit ddd1196
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions Content.Tests/DMProject/Tests/Operators/Division.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
var/list/expected = list(
1,
"Error",
10,
"Error",
"Error", // index 5
"Error",
"Error",
"Error",
"Error",
"Error", // index 10
"Error",
"Error",
"Error",
"Error",
"Error", // index 15
"Error",
"Error",
"Error",
"Error",
"Error", // index 20
"Error",
"Error",
"Error",
"Error",
"Error",
"Error",
"Error",
0,
0,
0,
0, // index 25
0,
0,
0,
0,
0, // index 30
0,
0,
0,
0,
"Error",
"Error",
"Error", // index 35
"Error",
"Error",
"Error",
Expand Down Expand Up @@ -128,4 +128,4 @@
"Error"
)

test_binary_operator(/proc/divide, expected)
test_binary_operator(/proc/divide, expected)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var/list/operator_test_values = list(
result = "Error"

if (result ~! expected_result)
CRASH("Expected [json_encode(expected_result)] for [json_encode(a)], instead got [json_encode(result)]")
CRASH("Expected [json_encode(expected_result)] for [json_encode(a)], instead got [json_encode(result)] at index [i - 1]")

/proc/test_binary_operator(var/operator_proc, var/list/expected)
var/i = 1
Expand All @@ -48,4 +48,4 @@ var/list/operator_test_values = list(
result = "Error"

if (result ~! expected_result)
CRASH("Expected [json_encode(expected_result)] for [json_encode(a)] and [json_encode(b)], instead got [json_encode(result)]")
CRASH("Expected [json_encode(expected_result)] for [json_encode(a)] and [json_encode(b)], instead got [json_encode(result)] at index [i - 1]")

0 comments on commit ddd1196

Please sign in to comment.