Skip to content

Commit

Permalink
Update test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
wezm committed Apr 23, 2024
1 parent 4649f16 commit 3197942
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,23 @@ use predicates::prelude::*;
fn dump_glyph() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("allsorts")?;
cmd.args(&["dump", "-g", "1", "tests/Basic-Regular.ttf"]);
cmd.assert().success().stdout(predicate::str::starts_with(
"Parsed(\n Glyph {\n number_of_contours: 3,",
));
let expected = r#"Parsed(
Simple(
SimpleGlyph {
bounding_box: BoundingBox {
x_min: 158,
x_max: 1082,
y_min: 0,
y_max: 1358,
},
end_pts_of_contours: [
22,
35,
44,
],"#;
cmd.assert()
.success()
.stdout(predicate::str::starts_with(expected));

Ok(())
}
Expand All @@ -19,7 +33,15 @@ fn dump_empty_glyph() -> Result<(), Box<dyn std::error::Error>> {
// Glyph 112 is .null
let mut cmd = Command::cargo_bin("allsorts")?;
cmd.args(&["dump", "-g", "112", "tests/Basic-Regular.ttf"]);
cmd.assert().success().stdout("Empty\n");
let expected = r#"Parsed(
Empty(
EmptyGlyph {
phantom_points: None,
},
),
)
"#;
cmd.assert().success().stdout(expected);

Ok(())
}

0 comments on commit 3197942

Please sign in to comment.