Skip to content

Commit e33b984

Browse files
committed
Updated unit tests
1 parent 76d7d5a commit e33b984

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

Tests/OSCKitTests/TCP/SLIP Coding Tests.swift

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,26 @@ import Testing
123123
}
124124
}
125125

126-
/// Test for error: encountering an escaped character without first receiving an ESC byte.
126+
/// Encountering an escaped character without first receiving an ESC byte
127+
/// should treat the byte as-is.
127128
@Test
128129
func dataSlipDecoded_MissingEscapeByte() throws {
129-
#expect(throws: OSCTCPSLIPDecodingError.missingEscapeByte) {
130+
#expect(
130131
try Data([END, 0x01, ESC_ESC, 0x02, END]).slipDecoded()
131-
}
132-
#expect(throws: OSCTCPSLIPDecodingError.missingEscapeByte) {
132+
== [Data([0x01, ESC_ESC, 0x02])]
133+
)
134+
#expect(
133135
try Data([END, 0x01, ESC_END, 0x02, END]).slipDecoded()
134-
}
135-
#expect(throws: OSCTCPSLIPDecodingError.missingEscapeByte) {
136+
== [Data([0x01, ESC_END, 0x02])]
137+
)
138+
#expect(
136139
try Data([END, ESC_ESC, END]).slipDecoded()
137-
}
138-
#expect(throws: OSCTCPSLIPDecodingError.missingEscapeByte) {
140+
== [Data([ESC_ESC])]
141+
)
142+
#expect(
139143
try Data([END, ESC_END, END]).slipDecoded()
140-
}
144+
== [Data([ESC_END])]
145+
)
141146
}
142147

143148
/// Test for error: missing valid escaped character after receiving ESC byte.

0 commit comments

Comments
 (0)