diff options
Diffstat (limited to 'Tests')
| -rw-r--r-- | Tests/WmapParserTests/ComponentParserTests.swift | 21 | ||||
| -rw-r--r-- | Tests/WmapParserTests/DependenciesParserTests.swift | 3 | ||||
| -rw-r--r-- | Tests/WmapParserTests/NotesParserTests.swift | 16 | ||||
| -rw-r--r-- | Tests/WmapParserTests/WmapParserTests.swift | 39 |
4 files changed, 53 insertions, 26 deletions
diff --git a/Tests/WmapParserTests/ComponentParserTests.swift b/Tests/WmapParserTests/ComponentParserTests.swift index 1f3a451..624f433 100644 --- a/Tests/WmapParserTests/ComponentParserTests.swift +++ b/Tests/WmapParserTests/ComponentParserTests.swift @@ -9,7 +9,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Dominoes", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle + label: "Dominoes", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle ) ) } @@ -33,7 +34,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "API", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.6), shape: .xMark) + label: "API", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.6), + shape: .xMark) ) } @@ -56,7 +58,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Process", coordinates: WmapParser.MapPoint(xCoordinate: 0.2, yCoordinate: 0.9), shape: .circle) + label: "Process", coordinates: WmapParser.MapPoint(xCoordinate: 0.2, yCoordinate: 0.9), + shape: .circle) ) } @@ -79,7 +82,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Item", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.123), shape: .circle) + label: "Item", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.123), + shape: .circle) ) } @@ -90,7 +94,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Item", coordinates: WmapParser.MapPoint(xCoordinate: 1.0, yCoordinate: 0.0), shape: .circle) + label: "Item", coordinates: WmapParser.MapPoint(xCoordinate: 1.0, yCoordinate: 0.0), + shape: .circle) ) } @@ -101,7 +106,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "RubberGaskets", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5), + label: "RubberGaskets", + coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5), shape: .circle) ) } @@ -113,7 +119,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Big Lawnmowers", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5), + label: "Big Lawnmowers", + coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5), shape: .circle) ) } diff --git a/Tests/WmapParserTests/DependenciesParserTests.swift b/Tests/WmapParserTests/DependenciesParserTests.swift index 356d5d3..4911ce0 100644 --- a/Tests/WmapParserTests/DependenciesParserTests.swift +++ b/Tests/WmapParserTests/DependenciesParserTests.swift @@ -29,7 +29,8 @@ import Testing #expect(result.dependencies.count == 1) #expect( result.dependencies.first - == WmapParser.Dependency(fromComponent: "SaRcAsM", toComponent: "Seriousness.", isDirected: true) + == WmapParser.Dependency( + fromComponent: "SaRcAsM", toComponent: "Seriousness.", isDirected: true) ) } diff --git a/Tests/WmapParserTests/NotesParserTests.swift b/Tests/WmapParserTests/NotesParserTests.swift index ae99c75..9e906dc 100644 --- a/Tests/WmapParserTests/NotesParserTests.swift +++ b/Tests/WmapParserTests/NotesParserTests.swift @@ -8,7 +8,9 @@ import Testing #expect(result.notes.count == 1) #expect( result.notes.first - == WmapParser.Note(text: "This is a note", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5)) + == WmapParser.Note( + text: "This is a note", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5) + ) ) } @@ -18,7 +20,8 @@ import Testing #expect(result.notes.count == 1) #expect( result.notes.first - == WmapParser.Note(text: "Text", coordinates: WmapParser.MapPoint(xCoordinate: 0.1, yCoordinate: 0.2)) + == WmapParser.Note( + text: "Text", coordinates: WmapParser.MapPoint(xCoordinate: 0.1, yCoordinate: 0.2)) ) } @@ -28,7 +31,9 @@ import Testing #expect(result.notes.count == 1) #expect( result.notes.first - == WmapParser.Note(text: "Important NOTE", coordinates: WmapParser.MapPoint(xCoordinate: 0.77, yCoordinate: 0.19)) + == WmapParser.Note( + text: "Important NOTE", + coordinates: WmapParser.MapPoint(xCoordinate: 0.77, yCoordinate: 0.19)) ) } @@ -37,9 +42,10 @@ import Testing let result = WmapParser.parse(source) #expect(result.notes.count == 1) #expect( - result.notes.first == WmapParser.Note( + result.notes.first + == WmapParser.Note( text: "", coordinates: WmapParser.MapPoint(xCoordinate: 0.5, yCoordinate: 0.5) - ) + ) ) } diff --git a/Tests/WmapParserTests/WmapParserTests.swift b/Tests/WmapParserTests/WmapParserTests.swift index f5dfe38..baf114f 100644 --- a/Tests/WmapParserTests/WmapParserTests.swift +++ b/Tests/WmapParserTests/WmapParserTests.swift @@ -13,12 +13,14 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Water", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle) + label: "Water", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle) ) #expect( result.components[1] == WmapParser.Component( - label: "Bucket", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), shape: .xMark) + label: "Bucket", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), + shape: .xMark) ) #expect(result.dependencies.count == 1) #expect( @@ -34,13 +36,15 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Penguins", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle + label: "Penguins", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle ) ) #expect( result.components[1] == WmapParser.Component( - label: "I Use Arch BTW", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), + label: "I Use Arch BTW", + coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), shape: .xMark) ) } @@ -52,7 +56,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Clippy", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle) + label: "Clippy", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle) ) #expect( result.components[1] @@ -69,12 +74,14 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "SE/30", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle) + label: "SE/30", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle) ) #expect( result.components[1] == WmapParser.Component( - label: "Performa", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), shape: .xMark) + label: "Performa", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), + shape: .xMark) ) } @@ -89,7 +96,8 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "The Void", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle + label: "The Void", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle ) ) #expect( @@ -171,12 +179,14 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Hello", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle) + label: "Hello", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle) ) #expect( result.components[1] == WmapParser.Component( - label: "It's OK", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), shape: .circle) + label: "It's OK", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), + shape: .circle) ) #expect(result.dependencies.count == 1) #expect( @@ -267,17 +277,20 @@ import Testing #expect( result.components.first == WmapParser.Component( - label: "Tea", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), shape: .circle) + label: "Tea", coordinates: WmapParser.MapPoint(xCoordinate: 0.9, yCoordinate: 0.5), + shape: .circle) ) #expect( result.components[1] == WmapParser.Component( - label: "Cup", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), shape: .circle) + label: "Cup", coordinates: WmapParser.MapPoint(xCoordinate: 0.8, yCoordinate: 0.4), + shape: .circle) ) #expect( result.components[2] == WmapParser.Component( - label: "Kettle", coordinates: WmapParser.MapPoint(xCoordinate: 0.7, yCoordinate: 0.3), shape: .square) + label: "Kettle", coordinates: WmapParser.MapPoint(xCoordinate: 0.7, yCoordinate: 0.3), + shape: .square) ) #expect( result.components[3] |