Skip to content

Commit

Permalink
fix ~600MB Github CI log files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharktheone committed Aug 4, 2024
1 parent eaef816 commit 9bda258
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions crates/gosub_html5/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::cell::RefCell;
use core::option::Option::Some;
use std::collections::HashMap;
#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
use std::io::Write;
use std::rc::Rc;

Expand Down Expand Up @@ -454,7 +454,7 @@ impl<'chars> Html5Parser<'chars> {
}
}

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
self.display_debug_info();
}

Expand Down Expand Up @@ -2724,7 +2724,7 @@ impl<'chars> Html5Parser<'chars> {
{
self.adoption_agency_algorithm(&self.current_token.clone());

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
self.display_debug_info();
}
Token::StartTag { name, .. }
Expand Down Expand Up @@ -3799,7 +3799,7 @@ impl<'chars> Html5Parser<'chars> {
self.insertion_mode = InsertionMode::Text;
}

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
fn display_debug_info(&self) {
println!("-----------------------------------------\n");
println!("current token : '{}'", self.current_token);
Expand Down
22 changes: 11 additions & 11 deletions src/bin/parser-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() {
}

fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
#[cfg(feature = "debug_parser_verbose")]
#[cfg(all(feature = "debug_parser_verbose", test))]
println!(
"🧪 Running test #{test_idx}: {}:{}",
test.file_path, test.line
Expand All @@ -75,7 +75,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
.run_test(test.clone(), false)
.expect("problem parsing");

// #[cfg(feature = "debug_parser")]
// #[cfg(all(feature = "debug_parser", not(test)))]
// print_test_result(&result);

for entry in &result.tree_results {
Expand All @@ -85,25 +85,25 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
ResultStatus::Success => {
all_results.succeeded += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!("✅ {}", entry.actual);
}
ResultStatus::Missing => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!("❌ {} (missing)", entry.expected);
}
ResultStatus::Additional => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!("❌ {} (unexpected)", entry.actual);
}
ResultStatus::Mismatch => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!("❌ {} (wanted: {})", entry.actual, entry.expected);
}
ResultStatus::IncorrectPosition => {}
Expand All @@ -117,7 +117,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
ResultStatus::Success => {
all_results.succeeded += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!(
"✅ ({}:{}) {}",
entry.actual.line, entry.actual.col, entry.actual.message
Expand All @@ -126,7 +126,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
ResultStatus::Missing => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!(
"❌ ({}:{}) {} (missing)",
entry.expected.line, entry.expected.col, entry.expected.message
Expand All @@ -135,7 +135,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
ResultStatus::Additional => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!(
"❌ ({}:{}) {} (unexpected)",
entry.actual.line, entry.actual.col, entry.actual.message
Expand All @@ -144,7 +144,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
ResultStatus::Mismatch => {
all_results.failed += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!(
"❌ ({}:{}) {} (wanted: {})",
entry.actual.line,
Expand All @@ -157,7 +157,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {
all_results.failed += 1;
all_results.failed_position += 1;

#[cfg(feature = "debug_parser")]
#[cfg(all(feature = "debug_parser", test))]
println!(
"❌ ({}:{}) (wanted: ({}::{})) {}",
entry.actual.line,
Expand Down

0 comments on commit 9bda258

Please sign in to comment.