Skip to content

Commit

Permalink
Reverted color changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
orizi committed Feb 1, 2025
1 parent 99f0528 commit 6bee939
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 38 deletions.
34 changes: 16 additions & 18 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion crates/cairo-lang-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ smol_str.workspace = true
unescaper.workspace = true

[dev-dependencies]
anstream = "0.6.18"
cairo-lang-test-utils = { path = "../cairo-lang-test-utils", features = ["testing"] }
env_logger.workspace = true
pretty_assertions.workspace = true
Expand Down
11 changes: 4 additions & 7 deletions crates/cairo-lang-parser/src/parser_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,11 @@ fn test_colored_parsed_code(
colored::control::set_override(true);
let db = &SimpleParserDatabase::default();
let (syntax_root, _) = get_syntax_root_and_diagnostics_from_inputs(db, inputs);
use anstream::adapter::strip_str;

let colored_output = print_colored(db, &syntax_root, bool_input(&inputs["is_verbose"]));
let striped_output = strip_str(&colored_output).to_string();
assert_ne!(colored_output, striped_output, "The output is not colored");

TestRunnerResult {
outputs: OrderedHashMap::from([("expected".into(), striped_output)]),
outputs: OrderedHashMap::from([(
"expected_colored".into(),
print_colored(db, &syntax_root, bool_input(&inputs["is_verbose"])),
)]),
error: None,
}
}
Expand Down
24 changes: 12 additions & 12 deletions crates/cairo-lang-parser/src/parser_test_data/colored
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ false

//! > expected_diagnostics

//! > expected
;
#[attr]
fn foo(var1: int var2: felt252) -> int {
let bla = 7 + true + 'abc'; // comment
return bar(bla);
//! > expected_colored
;
#[attr]
fn foo(var1: int var2: felt252) -> int {
let bla = 7 + true + 'abc'; // comment
return bar(bla);
}

//! > ==========================================================================
Expand All @@ -34,10 +34,10 @@ true

//! > expected_diagnostics

//! > expected
;
#[attr]
fn foo<e>(var1: int <m>var2: felt252) -> int {
let bla <e>= 7 + true + 'abc'; // comment
return bar(bla);
//! > expected_colored
;
#[attr]
fn foo<e>(var1: int <m>var2: felt252) -> int {
let bla <e>= 7 + true + 'abc'; // comment
return bar(bla);
}

0 comments on commit 6bee939

Please sign in to comment.