Skip to content

Commit

Permalink
fixed all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Sep 29, 2024
1 parent 64c60bb commit 9ad5ea8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion crates/gosub_html5/src/node/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ mod tests {
}

#[test]
#[should_panic]
#[should_panic(expected = "assertion `left == right` failed: Node is already attached to an arena")]
fn register_node_twice() {
let mut doc_handle = DocumentBuilderImpl::new_document(None);

Expand Down
1 change: 0 additions & 1 deletion crates/gosub_html5/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ where
// If reprocess_token is true, we should process the same token again
if !self.reprocess_token {
self.current_token = self.fetch_next_token();
println!("Token: {:?}", self.current_token);

// If we reprocess a given token, the dispatcher mode should stay the same and
// should not be re-evaluated
Expand Down
14 changes: 7 additions & 7 deletions crates/gosub_html5/src/parser/tree_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ mod tests {
.run_test::<Html5Parser<DocumentImpl<Css3System>, Css3System>, Css3System>(test.clone(), scripting_enabled)
.expect("problem parsing");

println!(
"tree construction: {}:{}\n{}",
test.file_path,
test.line,
test.document_as_str()
);
// println!(
// "tree construction: {}:{}\n{}",
// test.file_path,
// test.line,
// test.document_as_str()
// );
if result.is_success() == false {
println!("tree construction failed: {:#?}", result);
}
println!("{:?}\n", result);
// println!("{:?}\n", result);
assert!(result.is_success());
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/gosub_testing/src/testing/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ impl TestSpec {
}

pub fn assert_valid(&self) {
println!("Test: {}", self.description);

for mut builder in self.builders() {
let mut tokenizer = builder.build();

Expand Down
6 changes: 0 additions & 6 deletions crates/gosub_testing/src/testing/tree_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,7 @@ impl Harness {
self.test = test;
self.next_document_line = 0;

println!("{:?}", self.test.spec_data());

let (actual_document, actual_errors) = self.do_parse::<P, C>(scripting_enabled)?;

println!("Document parsed:");
println!("{}", actual_document.get());

let result = self.generate_test_result::<P, C>(actual_document.clone(), &actual_errors);

Ok(result)
Expand Down

0 comments on commit 9ad5ea8

Please sign in to comment.