Skip to content

Commit bf27c81

Browse files
committed
Add additional test cases for strings with spaces
1 parent a99f745 commit bf27c81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tests/ConfigurationTests/EnvironmentVariablesProviderTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct EnvironmentVariablesProviderTests {
7878
(false, ["No", "no", "NO", "nO"]),
7979
(true, ["true", "TRUE", "trUe"]),
8080
(false, ["false", "FALSE", "faLse"]),
81-
(nil, ["", "_true_", "_false_", "_yes_", "_no_", "_1_", "_0_", "11", "00"])
81+
(nil, ["", " ", "_true_", "_false_", "_yes_", "_no_", "_1_", "_0_", "11", "00"])
8282
]
8383
for (expected, inputs) in cases {
8484
for input in inputs {
@@ -103,6 +103,7 @@ struct EnvironmentVariablesProviderTests {
103103
"BOOLY_ARRAY_FALSE": "false,0,NO",
104104
"BOOLY_ARRAY_THROWS_1": "true,1,YESS",
105105
"BOOLY_ARRAY_THROWS_2": "false,00,no",
106+
"BOOLY_ARRAY_THROWS_3": "false, ,no",
106107
])
107108
#expect(try sut.value(forKey: "BOOL_TRUE", type: .bool).value == true)
108109
#expect(try sut.value(forKey: "BOOL_FALSE", type: .bool).value == false)
@@ -116,6 +117,7 @@ struct EnvironmentVariablesProviderTests {
116117
#expect(try sut.value(forKey: "BOOLY_ARRAY_FALSE", type: .boolArray).value == .init([false, false, false], isSecret: false))
117118
#expect(throws: ConfigError.self) { try sut.value(forKey: "BOOLY_ARRAY_THROWS_1", type: .boolArray) }
118119
#expect(throws: ConfigError.self) { try sut.value(forKey: "BOOLY_ARRAY_THROWS_2", type: .boolArray) }
120+
#expect(throws: ConfigError.self) { try sut.value(forKey: "BOOLY_ARRAY_THROWS_3", type: .boolArray) }
119121
}
120122

121123
@available(Configuration 1.0, *)

0 commit comments

Comments
 (0)