Skip to content

Commit d4bb945

Browse files
committed
Update test, after Godot changed number of equality comparisons in Dictionary
1 parent 3d053d7 commit d4bb945

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

itest/rust/src/builtin_tests/containers/callable_test.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ pub mod custom_callable {
165165
use super::*;
166166
use crate::framework::assert_eq_self;
167167
use godot::builtin::{Dictionary, RustCallable};
168+
use godot::sys::GdextBuild;
168169
use std::fmt;
169170
use std::hash::Hash;
170171
use std::sync::{Arc, Mutex};
@@ -285,8 +286,12 @@ pub mod custom_callable {
285286
dict.set(b, "hi");
286287
assert_eq!(hash_count(&at), 1, "hash for a untouched if b is inserted");
287288
assert_eq!(hash_count(&bt), 1, "hash needed for b dict key");
288-
assert_eq!(eq_count(&at), 1, "hash collision, eq for a needed");
289-
assert_eq!(eq_count(&bt), 1, "hash collision, eq for b needed");
289+
290+
// Introduced in https://github.com/godotengine/godot/pull/96797.
291+
let eq = if GdextBuild::since_api("4.4") { 2 } else { 1 };
292+
293+
assert_eq!(eq_count(&at), eq, "hash collision, eq for a needed");
294+
assert_eq!(eq_count(&bt), eq, "hash collision, eq for b needed");
290295
}
291296

292297
#[itest]

0 commit comments

Comments
 (0)