Skip to content

Commit 144f66a

Browse files
senamakelmedullabot
andcommitted
test(collapse): use helper variables for namespace definitions in test
Replace hardcoded string literals with variables from the `namespace_definition` helper in the member definitions test, making the assertions more readable and consistent with the rest of the test suite. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
1 parent 15bfeea commit 144f66a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • crates/tinytools/src/collapse

‎crates/tinytools/src/collapse/test.rs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,18 @@ fn member_definitions_are_preserved_and_namespaced() {
456456
tool: &second,
457457
},
458458
]);
459+
let first_definition = namespace_definition("first", "Options");
460+
let second_definition = namespace_definition("second", "Options");
459461
assert_eq!(
460462
merged["properties"]["options"]["anyOf"][0]["$ref"],
461-
"#/$defs/first_Options"
463+
format!("#/$defs/{first_definition}")
462464
);
463465
assert_eq!(
464466
merged["properties"]["options"]["anyOf"][1]["$ref"],
465-
"#/$defs/second_Options"
467+
format!("#/$defs/{second_definition}")
466468
);
467-
assert_eq!(merged["$defs"]["first_Options"]["type"], "string");
468-
assert_eq!(merged["$defs"]["second_Options"]["type"], "integer");
469+
assert_eq!(merged["$defs"][first_definition]["type"], "string");
470+
assert_eq!(merged["$defs"][second_definition]["type"], "integer");
469471
}
470472

471473
#[test]

0 commit comments

Comments
 (0)