mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refactor ChangeBatcher tests to remove skipped count checks
- Updated the `encodeInstance.stress.spec.lua` tests to eliminate checks for skipped counts, as duplicates are now included alongside unique children. - Adjusted expectations in the tests to reflect the new behavior of the encoding process, ensuring accurate validation of encoded instances. - Removed legacy assertions related to skipped counts, streamlining the test cases for better clarity and maintainability.
This commit is contained in:
parent
d6162ac210
commit
e313f61515
7 changed files with 53 additions and 132 deletions
|
|
@ -165,15 +165,24 @@ pub fn ref_target_path_from_tree(
|
|||
// Derive the filesystem name for this instance.
|
||||
let fs_name = if let Some(meta) = tree.get_metadata(current) {
|
||||
if let Some(source) = &meta.instigating_source {
|
||||
// Use the filename from the instigating source path.
|
||||
source
|
||||
.path()
|
||||
.file_name()
|
||||
.and_then(|f| f.to_str())
|
||||
.unwrap_or(&inst.name)
|
||||
.to_string()
|
||||
match source {
|
||||
crate::snapshot::InstigatingSource::Path(_) => {
|
||||
// File-backed instance: use the filename from disk.
|
||||
source
|
||||
.path()
|
||||
.file_name()
|
||||
.and_then(|f| f.to_str())
|
||||
.unwrap_or(&inst.name)
|
||||
.to_string()
|
||||
}
|
||||
crate::snapshot::InstigatingSource::ProjectNode { .. } => {
|
||||
// Project-sourced instance: use instance name, not the
|
||||
// project file path (which would be e.g. "default.project.json5").
|
||||
inst.name.clone()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No instigating source (project node, newly added) -- use name.
|
||||
// No instigating source (newly added) -- use name.
|
||||
inst.name.clone()
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue