@@ -19,7 +19,7 @@ import XCTest
19
19
final class FilePathDecodableTest : XCTestCase {
20
20
func testInvalidFilePath( ) {
21
21
// _storage is a valid SystemString, but the invariants of FilePath are
22
- // violated.
22
+ // violated (specifically, _storage is not normal) .
23
23
let input : [ UInt8 ] = [
24
24
123 , 34 , 95 , 115 , 116 , 111 , 114 , 97 , 103 , 101 , 34 , 58 , 123 , 34 , 110 , 117 , 108 , 108 ,
25
25
84 , 101 , 114 , 109 , 105 , 110 , 97 , 116 , 101 , 100 , 83 , 116 , 111 , 114 , 97 , 103 , 101 , 34 ,
@@ -77,7 +77,8 @@ final class FilePathDecodableTest: XCTestCase {
77
77
}
78
78
79
79
func testInvalidSystemString( ) {
80
- // _storage is a SystemString whose invariants are violated
80
+ // _storage is a SystemString whose invariants are violated; it contains
81
+ // a non-terminating null byte.
81
82
let input : [ UInt8 ] = [
82
83
123 , 34 , 95 , 115 , 116 , 111 , 114 , 97 , 103 , 101 , 34 , 58 , 123 , 34 , 110 , 117 , 108 , 108 ,
83
84
84 , 101 , 114 , 109 , 105 , 110 , 97 , 116 , 101 , 100 , 83 , 116 , 111 , 114 , 97 , 103 , 101 , 34 ,
@@ -95,7 +96,7 @@ final class FilePathDecodableTest: XCTestCase {
95
96
96
97
func testInvalidExample( ) {
97
98
// Another misformed example from Johannes that violates FilePath's
98
- // invariants
99
+ // invariants by virtue of not being normalized.
99
100
let input : [ UInt8 ] = [
100
101
123 , 34 , 95 , 115 , 116 , 111 , 114 , 97 , 103 , 101 , 34 , 58 , 123 , 34 , 110 , 117 , 108 , 108 ,
101
102
84 , 101 , 114 , 109 , 105 , 110 , 97 , 116 , 101 , 100 , 83 , 116 , 111 , 114 , 97 , 103 , 101 , 34 ,
@@ -113,6 +114,7 @@ final class FilePathDecodableTest: XCTestCase {
113
114
}
114
115
115
116
func testEmptyString( ) {
117
+ // FilePath with an empty (and hence not null-terminated) SystemString.
116
118
let input : [ UInt8 ] = [
117
119
123 , 34 , 95 , 115 , 116 , 111 , 114 , 97 , 103 , 101 , 34 , 58 , 123 , 34 , 110 , 117 , 108 , 108 ,
118
120
84 , 101 , 114 , 109 , 105 , 110 , 97 , 116 , 101 , 100 , 83 , 116 , 111 , 114 , 97 , 103 , 101 , 34 ,
0 commit comments