diff options
author | Jovansonlee Cesar <ivanceras@gmail.com> | 2023-04-15 13:44:23 +0800 |
---|---|---|
committer | Jovansonlee Cesar <ivanceras@gmail.com> | 2023-04-15 13:44:23 +0800 |
commit | 6b3765c640d3ec306e026e99d1b93bee5f53799c (patch) | |
tree | 0aa9f81977fc5db40d5f0cacb2cc813519dd5893 /packages | |
parent | b575ef693c8e2b439f64be8b1e07bd40ac5b0ce2 (diff) |
fix:tests
Diffstat (limited to 'packages')
-rw-r--r-- | packages/svgbob/tests/simple_shapes.rs | 10 | ||||
-rw-r--r-- | packages/svgbob/tests/styling.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/svgbob/tests/simple_shapes.rs b/packages/svgbob/tests/simple_shapes.rs index 3313c50..0b891fc 100644 --- a/packages/svgbob/tests/simple_shapes.rs +++ b/packages/svgbob/tests/simple_shapes.rs @@ -8,7 +8,7 @@ fn rect1() { +----------+ "#; - let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="136" height="80"> + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="136" height="80" class="svgbob"> <rect x="36" y="24" width="88" height="32" class="solid nofill" rx="0"></rect> </svg>"#; @@ -25,7 +25,7 @@ fn escaped_shape() { "+----------+" "#; - let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="16" height="32"> + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="16" height="32" class="svgbob"> <text x="34" y="28" >+----------+</text> <text x="34" y="44" >| |</text> <text x="34" y="60" >+----------+</text> @@ -44,7 +44,7 @@ fn rounded_rect() { '----------' "#; - let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="136" height="80"> + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="136" height="80" class="svgbob"> <rect x="36" y="24" width="88" height="32" class="solid nofill" rx="4"></rect> </svg>"#; @@ -59,7 +59,7 @@ fn just_v() { V "#; - let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="80" height="48"> + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="80" height="48" class="svgbob"> <text x="66" y="28" >V</text> </svg>"#; @@ -75,7 +75,7 @@ fn arrow_down() { V "#; - let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="80" height="64"> + let expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="80" height="64" class="svgbob"> <line x1="68" y1="16" x2="68" y2="36" class="solid"></line> <polygon points="64,36 72,36 68,48" class="filled"></polygon> </svg>"#; diff --git a/packages/svgbob/tests/styling.rs b/packages/svgbob/tests/styling.rs index cfe07dd..3266534 100644 --- a/packages/svgbob/tests/styling.rs +++ b/packages/svgbob/tests/styling.rs @@ -24,7 +24,7 @@ w = { println!("{}", &svg); - let _expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="224" height="208"><style>line, path, circle,rect,polygon{stroke:black;stroke-width:2;stroke-opacity:1;fill-opacity:1;stroke-linecap:round;stroke-linejoin:miter;}text{font-family:monospace;font-size:14px;}rect.backdrop{stroke:none;fill:white;}.broken{stroke-dasharray:8;}.filled{fill:black;}.bg_filled{fill:white;}.nofill{fill:white;}.end_marked_arrow{marker-end:url(#arrow);}.start_marked_arrow{marker-start:url(#arrow);}.end_marked_diamond{marker-end:url(#diamond);}.start_marked_diamond{marker-start:url(#diamond);}.end_marked_circle{marker-end:url(#circle);}.start_marked_circle{marker-start:url(#circle);}.end_marked_open_circle{marker-end:url(#open_circle);}.start_marked_open_circle{marker-start:url(#open_circle);}.end_marked_big_open_circle{marker-end:url(#big_open_circle);}.start_marked_big_open_circle{marker-start:url(#big_open_circle);}.w{ + let _expected = r#"<svg xmlns="http://www.w3.org/2000/svg" width="224" height="208" class="svgbob"><style>line, path, circle,rect,polygon{stroke:black;stroke-width:2;stroke-opacity:1;fill-opacity:1;stroke-linecap:round;stroke-linejoin:miter;}text{font-family:monospace;font-size:14px;}rect.backdrop{stroke:none;fill:white;}.broken{stroke-dasharray:8;}.filled{fill:black;}.bg_filled{fill:white;}.nofill{fill:white;}.end_marked_arrow{marker-end:url(#arrow);}.start_marked_arrow{marker-start:url(#arrow);}.end_marked_diamond{marker-end:url(#diamond);}.start_marked_diamond{marker-start:url(#diamond);}.end_marked_circle{marker-end:url(#circle);}.start_marked_circle{marker-start:url(#circle);}.end_marked_open_circle{marker-end:url(#open_circle);}.start_marked_open_circle{marker-start:url(#open_circle);}.end_marked_big_open_circle{marker-end:url(#big_open_circle);}.start_marked_big_open_circle{marker-start:url(#big_open_circle);}.w{ fill: #abadb0; }</style><defs><marker id="arrow" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><polygon points="0,0 0,4 4,2 0,0"></polygon></marker><marker id="diamond" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><polygon points="0,2 2,0 4,2 2,4 0,2"></polygon></marker><marker id="circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><circle cx="4" cy="4" r="2" class="filled"></circle></marker><marker id="open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><circle cx="4" cy="4" r="2" class="bg_filled"></circle></marker><marker id="big_open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><circle cx="4" cy="4" r="3" class="bg_filled"></circle></marker></defs><rect class="backdrop" x="0" y="0" width="224" height="208"></rect><rect x="124" y="24" width="88" height="32" class="solid nofill w" rx="4"></rect><text x="162" y="44" >B</text><rect x="4" y="88" width="88" height="32" class="solid nofill w" rx="4"></rect><text x="42" y="108" >A</text><rect x="4" y="152" width="88" height="32" class="solid nofill w" rx="4"></rect><text x="42" y="172" >A</text><rect x="124" y="152" width="88" height="32" class="solid nofill w" rx="4"></rect><text x="162" y="172" >B</text><text x="10" y="44" >{w}</text><text x="42" y="44" >A</text><text x="130" y="108" >{w}</text><text x="162" y="108" >B</text><g><path d="M 8,24 A 4,4 0,0,0 4,28" class="nofill"></path><line x1="4" y1="28" x2="4" y2="52" class="solid"></line><line x1="8" y1="24" x2="88" y2="24" class="solid"></line><path d="M 88,24 A 4,4 0,0,1 92,28" class="nofill"></path><line x1="92" y1="28" x2="92" y2="52" class="solid"></line><line x1="92" y1="40" x2="112" y2="40" class="solid"></line><polygon points="112,36 120,40 112,44" class="filled"></polygon><path d="M 4,52 A 4,4 0,0,0 8,56" class="nofill"></path><line x1="8" y1="56" x2="88" y2="56" class="solid"></line><path d="M 92,52 A 4,4 0,0,1 88,56" class="nofill"></path></g><g><path d="M 128,88 A 4,4 0,0,0 124,92" class="nofill"></path><line x1="124" y1="92" x2="124" y2="116" class="solid"></line><line x1="128" y1="88" x2="208" y2="88" class="solid"></line><path d="M 208,88 A 4,4 0,0,1 212,92" class="nofill"></path><line x1="212" y1="92" x2="212" y2="116" class="solid"></line><path d="M 124,116 A 4,4 0,0,0 128,120" class="nofill"></path><line x1="128" y1="120" x2="208" y2="120" class="solid"></line><path d="M 212,116 A 4,4 0,0,1 208,120" class="nofill"></path><polygon points="104,100 96,104 104,108" class="filled"></polygon><line x1="104" y1="104" x2="124" y2="104" class="solid"></line></g><g><polygon points="104,164 96,168 104,172" class="filled"></polygon><line x1="104" y1="168" x2="112" y2="168" class="solid"></line><polygon points="112,164 120,168 112,172" class="filled"></polygon></g></svg>"#; } |