File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // File.swift
3+ //
4+ //
5+ // Created by Tibor Bodecs on 2021. 11. 29..
6+ //
7+
8+
9+ public final class Circle : Tag {
10+
11+ public init ( cx: Int , cy: Int , r: Int ) {
12+ super. init ( Node ( type: . standard, name: " circle " , attributes: [
13+ . init( key: " cx " , value: String ( cx) ) ,
14+ . init( key: " cy " , value: String ( cy) ) ,
15+ . init( key: " r " , value: String ( r) ) ,
16+ ] ) )
17+
18+ }
19+ }
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import XCTest
1010
1111final class SvgTests : XCTestCase {
1212
13- func testSvg( ) {
14-
13+ func testSvgWithLine( ) {
1514 let doc = Document ( . unspecified) {
1615 Svg {
1716 Line ( x1: 1 , y1: 2 , x2: 3 , y2: 4 )
@@ -27,5 +26,14 @@ final class SvgTests: XCTestCase {
2726 }
2827 XCTAssertEqual ( DocumentRenderer ( minify: true ) . render ( doc) , #"<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="1" y1="2" x2="3" y2="4"></line></svg>"# )
2928 }
29+
30+ func testSvgWithCircle( ) {
31+ let doc = Document ( . unspecified) {
32+ Svg {
33+ Circle ( cx: 1 , cy: 2 , r: 3 )
34+ }
35+ }
36+ XCTAssertEqual ( DocumentRenderer ( minify: true ) . render ( doc) , #"<svg><circle cx="1" cy="2" r="3"></circle></svg>"# )
37+ }
3038
3139}
You can’t perform that action at this time.
0 commit comments