forked from rust-windowing/winit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't include the closing segment when printing a path as a string.
Closes rust-windowing#279. Closes rust-windowing#282.
- Loading branch information
Showing
7 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// pathfinder/canvas/src/tests.rs | ||
// | ||
// For this file only, any copyright is dedicated to the Public Domain. | ||
// https://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
use pathfinder_geometry::vector::Vector2F; | ||
use super::Path2D; | ||
|
||
#[test] | ||
pub fn test_path2d_formatting() { | ||
let mut path = Path2D::new(); | ||
path.move_to(Vector2F::new(0.0, 1.0)); | ||
path.line_to(Vector2F::new(2.0, 3.0)); | ||
assert_eq!(format!("{:?}", path), "M 0 1 L 2 3"); | ||
path.line_to(Vector2F::new(4.0, 5.0)); | ||
assert_eq!(format!("{:?}", path), "M 0 1 L 2 3 L 4 5"); | ||
path.close_path(); | ||
assert_eq!(format!("{:?}", path), "M 0 1 L 2 3 L 4 5 z"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters