-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GD-347: Allow to compare real vs int typed dictionary #347
Comments
Hello, if you compare two dictionaries with different types, the result is always false. Just try this var x := { "left" : 50, "top" : 50, "right" : 50, "bottom" : 50 }
var y := { "left" : 50.0, "top" : 50.0, "right" : 50.0, "bottom" : 50.0 }
prints(x == y) is same result as use: Can you please add an example of your test for better understanding. |
Oh you're right. My apologies. I expected |
hi @ZodmanPerth can you please add your testcase to fully understand your issue. |
This test passes:
Only the last test here passes. I expected them all to. func test_dictionary_types(
value : Dictionary,
expected : Dictionary,
test_parameters : Array = [
[{ top = 50.0, bottom = 50.0, left = 50.0, right = 50.0}, { top = 50, bottom = 50, left = 50, right = 50}],
[{ top = 50.0, bottom = 50.0, left = 50.0, right = 50.0}, { top = 50.0, bottom = 50.0, left = 50.0, right = 50.0}],
[{ top = 50, bottom = 50, left = 50, right = 50}, { top = 50.0, bottom = 50.0, left = 50.0, right = 50.0}],
[{ top = 50, bottom = 50, left = 50, right = 50}, { top = 50, bottom = 50, left = 50, right = 50}],
]
) -> void:
assert_that(value).is_equal(expected) They also don't produce any failure report: |
The lack of bug reports is definitely a bug. |
Oooh nice. Thank you. |
The used Godot version:
v3.5.1.stable.official [6fed1ffa3]
OS including version:
Windows 11
Describe the bug
I'm using a dictionary in a parameterised test in GdUnit3 2.3.1. The dictionary contains key/value pairs of type string/double.
When I define my expected value dictionary, I define the values using whole numbers (i.e. without the decimal point).
The difference report shows the actual values are identical to the expected values (see image).
The expected values in the above test run were defined as
{ left = 50, top = 50, right = 50, bottom = 50 }
.As a workaround, if I define my expected values as
{ left = 50.0, top = 50.0, right = 50.0, bottom = 50.0 }
then the test passes.Steps to Reproduce
The text was updated successfully, but these errors were encountered: