tests: Add test for enumerating child instances

This commit is contained in:
Mike Welsh 2019-12-03 01:11:35 -08:00
parent f2422a2c9f
commit d30506dc59
4 changed files with 17 additions and 0 deletions

View File

@ -96,6 +96,19 @@ fn test_prototype_enumerate() -> Result<(), Error> {
Ok(())
}
#[test]
fn test_stage_object_enumerate() -> Result<(), Error> {
let trace_log = run_swf("tests/swfs/avm1/stage_object_enumerate/test.swf", 1)?;
let mut actual: Vec<String> = trace_log.lines().map(|s| s.to_string()).collect();
let mut expected = vec!["clip1", "clip2", "clip3", "foo"];
actual.sort();
expected.sort();
assert_eq!(actual, expected, "actual == expected");
Ok(())
}
/// Loads an SWF and runs it through the Ruffle core for a number of frames.
/// Tests that the trace output matches the given expected output.
fn test_swf(swf_path: &str, num_frames: u32, expected_output_path: &str) -> Result<(), Error> {

View File

@ -0,0 +1,4 @@
foo
clip3
clip2
clip1

Binary file not shown.

Binary file not shown.