aboutsummaryrefslogtreecommitdiff
path: root/Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift')
-rw-r--r--Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift19
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift b/Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift
new file mode 100644
index 0000000..4f23feb
--- /dev/null
+++ b/Tests/NorgKitTests/Extensions/Array+InlineSpanTests.swift
@@ -0,0 +1,19 @@
+import Testing
+
+@testable import NorgKit
+
+struct ArrayInlineSpanTests {
+
+ @Test func plainTextConcatenatesSpanText() {
+ let spans = [
+ InlineSpan(text: "Hello, ", styles: .bold),
+ InlineSpan(text: "world", styles: .italic),
+ InlineSpan(text: "!"),
+ ]
+ #expect(spans.plainText == "Hello, world!")
+ }
+
+ @Test func plainTextOfEmptyArrayIsEmpty() {
+ #expect([InlineSpan]().plainText.isEmpty)
+ }
+}