mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor code for improved readability and consistency
- Simplified function calls and removed unnecessary line breaks in `change_processor.rs`, `rojo_ref.rs`, `syncback/meta.rs`, `syncback/mod.rs`, `syncback/ref_properties.rs`, and `web/api.rs` to enhance code clarity. - Updated test assertions in `two_way_sync.rs` for better readability by consolidating multiple lines into single assertions. These changes improve the overall maintainability and readability of the codebase.
This commit is contained in:
parent
b8c3520d25
commit
6f8e5a5cf2
7 changed files with 32 additions and 88 deletions
|
|
@ -6423,11 +6423,7 @@ fn ref_with_name_change() {
|
|||
poll_file_exists(&new_meta, "Meta file should exist at new location");
|
||||
|
||||
// The ref path should be updated to reflect the renamed parent
|
||||
assert_meta_has_ref_attr(
|
||||
&new_meta,
|
||||
"Rojo_Ref_PrimaryPart",
|
||||
"@self/Part1.model.json5",
|
||||
);
|
||||
assert_meta_has_ref_attr(&new_meta, "Rojo_Ref_PrimaryPart", "@self/Part1.model.json5");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -6859,11 +6855,7 @@ fn ref_ambiguous_path_no_crash() {
|
|||
let meta_path = session
|
||||
.path()
|
||||
.join("src/Workspace/DupParent/init.meta.json5");
|
||||
poll_meta_has_ref_attr(
|
||||
&meta_path,
|
||||
"Rojo_Ref_PrimaryPart",
|
||||
"./Target.model.json5",
|
||||
);
|
||||
poll_meta_has_ref_attr(&meta_path, "Rojo_Ref_PrimaryPart", "./Target.model.json5");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -7024,11 +7016,7 @@ fn ref_partial_removal_preserves_remaining_index_entry() {
|
|||
"@self/Part1.model.json5",
|
||||
);
|
||||
// Verify second ref is there too
|
||||
assert_meta_has_ref_attr(
|
||||
&meta_path,
|
||||
"Rojo_Ref_Adornee",
|
||||
"@self/Part2.model.json5",
|
||||
);
|
||||
assert_meta_has_ref_attr(&meta_path, "Rojo_Ref_Adornee", "@self/Part2.model.json5");
|
||||
|
||||
// Step 2: Remove PrimaryPart (set to nil), keep Adornee
|
||||
let mut props2 = UstrMap::default();
|
||||
|
|
@ -7048,11 +7036,7 @@ fn ref_partial_removal_preserves_remaining_index_entry() {
|
|||
thread::sleep(Duration::from_millis(300));
|
||||
assert_meta_no_ref_attr(&meta_path, "Rojo_Ref_PrimaryPart");
|
||||
// Adornee should still be there
|
||||
assert_meta_has_ref_attr(
|
||||
&meta_path,
|
||||
"Rojo_Ref_Adornee",
|
||||
"@self/Part2.model.json5",
|
||||
);
|
||||
assert_meta_has_ref_attr(&meta_path, "Rojo_Ref_Adornee", "@self/Part2.model.json5");
|
||||
|
||||
// Step 3: Rename Part2. The RefPathIndex should still have the entry
|
||||
// for Adornee (not overbroad-removed when PrimaryPart was deleted).
|
||||
|
|
@ -7350,11 +7334,7 @@ fn ref_same_batch_add_module_target_includes_extension() {
|
|||
let meta_path = session
|
||||
.path()
|
||||
.join("src/Workspace/TestModel/init.meta.json5");
|
||||
poll_meta_has_ref_attr(
|
||||
&meta_path,
|
||||
"Rojo_Ref_PrimaryPart",
|
||||
"./ModuleTarget.luau",
|
||||
);
|
||||
poll_meta_has_ref_attr(&meta_path, "Rojo_Ref_PrimaryPart", "./ModuleTarget.luau");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue