aboutsummaryrefslogtreecommitdiff
path: root/Tests/WmapParserTests/StagesParserTests.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2025-12-13 01:17:52 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2025-12-14 09:15:07 +0100
commit03f1a7389afeadf9aa2b1d62a38e5cb0a2a7e60d (patch)
tree2efefc34a61c62d55d8436180acfc3590287f5fd /Tests/WmapParserTests/StagesParserTests.swift
Initial implementation
Diffstat (limited to 'Tests/WmapParserTests/StagesParserTests.swift')
-rw-r--r--Tests/WmapParserTests/StagesParserTests.swift48
1 files changed, 48 insertions, 0 deletions
diff --git a/Tests/WmapParserTests/StagesParserTests.swift b/Tests/WmapParserTests/StagesParserTests.swift
new file mode 100644
index 0000000..50bab4b
--- /dev/null
+++ b/Tests/WmapParserTests/StagesParserTests.swift
@@ -0,0 +1,48 @@
+import Testing
+
+@testable import WmapParser
+
+@Test func shouldParseStageI() {
+ let source = "[I] 0.25"
+ let result = parse(source)
+ #expect(result.stages.count == 1)
+ #expect(
+ result.stages.first == Stage(stage: .stageI, value: 0.25)
+ )
+}
+
+@Test func shouldParseStageII() {
+ let source = "[ii] 0.5"
+ let result = parse(source)
+ #expect(result.stages.count == 1)
+ #expect(
+ result.stages.first == Stage(stage: .stageII, value: 0.5)
+ )
+}
+
+@Test func shouldParseStageIII() {
+ let source = "[III] 0.75"
+ let result = parse(source)
+ #expect(result.stages.count == 1)
+ #expect(
+ result.stages.first == Stage(stage: .stageIII, value: 0.75)
+ )
+}
+
+@Test func shouldParseStageIV() {
+ let source = "[Iv] 1.0"
+ let result = parse(source)
+ #expect(result.stages.count == 1)
+ #expect(
+ result.stages.first == Stage(stage: .stageIV, value: 1.0)
+ )
+}
+
+@Test func shouldHandleDecimalValues() {
+ let source = "[i] .333"
+ let result = parse(source)
+ #expect(result.stages.count == 1)
+ #expect(
+ result.stages.first == Stage(stage: .stageI, value: 0.333)
+ )
+}