Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Aug 18, 2024
1 parent a8d9eda commit 242f665
Show file tree
Hide file tree
Showing 5 changed files with 1,916 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tooling/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ walkdir = "2"
elf = "0.7"
memchr = "2"

[dev-dependencies]
insta = "1"

[target."cfg(windows)".dependencies.windows-sys]
version = "0.59"
features = [
Expand Down
18 changes: 18 additions & 0 deletions tooling/cli/src/helpers/pbxproj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,21 @@ pub struct BuildConfigurationRef {
pub id: String,
pub comments: String,
}

#[cfg(test)]
mod tests {
#[test]
fn parse() {
let manifest_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
let fixtures_path = manifest_dir.join("tests").join("fixtures").join("pbxproj");

let mut settings = insta::Settings::clone_current();
settings.set_snapshot_path(fixtures_path.join("snapshots"));
let _guard = settings.bind_to_scope();

insta::assert_debug_snapshot!(
"project.pbxproj",
super::parse(fixtures_path.join("project.pbxproj")).expect("failed to parse pbxproj")
);
}
}
Loading

0 comments on commit 242f665

Please sign in to comment.