diff options
author | Jovansonlee Cesar <ivanceras@gmail.com> | 2020-11-04 12:33:44 +0800 |
---|---|---|
committer | Jovansonlee Cesar <ivanceras@gmail.com> | 2020-11-04 12:33:44 +0800 |
commit | c3304e84fcf23d11e5c3287bd62127d9ece6a6be (patch) | |
tree | 07196e19c0a1a1ec5de53d554d803db445e3869d | |
parent | 206bef007ea58bef7aab1a4d20e55ccd8286188b (diff) |
Add rounded_rect tests
-rw-r--r-- | svgbob/tests/simple_shapes.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/svgbob/tests/simple_shapes.rs b/svgbob/tests/simple_shapes.rs index 8452d73..9ecf09d 100644 --- a/svgbob/tests/simple_shapes.rs +++ b/svgbob/tests/simple_shapes.rs @@ -20,3 +20,24 @@ fn rect1() { println!("{}", svg); assert_eq!(expected, svg); } + +#[test] +fn rounded_rect() { + let bob = r#" + .----------. + | | + '----------' + "#; + + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="136" height="80"> + <rect x="36" y="24" width="88" height="32" class="solid nofill" rx="4"></rect> +</svg>"#; + + let mut settings = Settings::default(); + settings.include_backdrop = false; + settings.include_styles = false; + settings.include_defs = false; + let svg = svgbob::to_svg_with_settings(bob, &settings); + println!("{}", svg); + assert_eq!(expected, svg); +} |