Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Oct 5, 2023
1 parent 90fa314 commit 2907866
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
pull_request:
types: [opened, reopened]

env:
TERM: xterm-256color
env:
CLICOLOR_FORCE: true
CARGO_TERM_COLOR: always

Expand All @@ -23,11 +22,6 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: build
- run:
echo "$TERM"
echo "$NO_COLOR"
echo "$CLICOLOR"
echo "$CLICOLOR_FORCE"
- uses: actions-rs/cargo@v1
with:
command: test
Expand Down
11 changes: 1 addition & 10 deletions pest-test/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,9 @@ impl<'a> ExpressionDiffFormatterExt for ExpressionFormatter<'a> {
expected_color: Option<Color>,
actual_color: Option<Color>,
) -> FmtResult {
println!("B");
match diff {
ExpressionDiff::Equal(expression) => {
println!("Equal");
self.fmt(expression)?
}
ExpressionDiff::Equal(expression) => self.fmt(expression)?,
ExpressionDiff::NotEqual { expected, actual } => {
println!("NotEqual");
self.color = expected_color;
self.fmt(expected)?;
self.write_newline()?;
Expand All @@ -243,19 +238,16 @@ impl<'a> ExpressionDiffFormatterExt for ExpressionFormatter<'a> {
self.color = None;
}
ExpressionDiff::Missing(expression) => {
println!("Missing");
self.color = expected_color;
self.fmt(expression)?;
self.color = None;
}
ExpressionDiff::Extra(expression) => {
println!("Extra");
self.color = actual_color;
self.fmt(expression)?;
self.color = None;
}
ExpressionDiff::Partial { name, children } => {
println!("Partial");
self.write_indent()?;
self.write_char('(')?;
self.write_str(name)?;
Expand Down Expand Up @@ -583,7 +575,6 @@ mod tests {
let diff = ExpressionDiff::from_expressions(&expected_sexpr, &test_case.expression, false);
let mut writer = String::new();
let mut formatter = ExpressionFormatter::from_defaults(&mut writer);
println!("A");
formatter
.fmt_diff(&diff, Some(Color::Green), Some(Color::Red))
.ok();
Expand Down
14 changes: 3 additions & 11 deletions pest-test/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,10 @@ impl<'a> ExpressionFormatter<'a> {
}

pub(crate) fn write_str(&mut self, s: &str) -> FmtResult {
println!("write_str {:?}", self.color);
match self.color {
Some(color) => {
let c = s.color(color);
println!("{:?}", c);
let s = format!("{}", c);
let ss = s.escape_default().to_string();
println!("write_str color {ss}");
self.writer.write_str(s.as_ref())
}
Some(color) => self
.writer
.write_str(format!("{}", s.color(color)).as_ref()),
None => self.writer.write_str(s),
}
}
Expand All @@ -225,7 +219,6 @@ impl<'a> ExpressionFormatter<'a> {
buffering: false,
};
string_formatter.fmt(expression)?;
println!("color {:?}", self.color);
self.write_str(buf.as_ref())?;
Ok(())
}
Expand Down Expand Up @@ -271,7 +264,6 @@ impl<'a> ExpressionFormatter<'a> {
}

pub fn fmt(&mut self, expression: &Expression) -> FmtResult {
println!("Buffering {} color {:?}", self.buffering, self.color);
if self.buffering {
self.fmt_buffered(expression)
} else {
Expand Down

0 comments on commit 2907866

Please sign in to comment.