@@ -4,7 +4,6 @@ import Foundation
44
55@Suite ( " Configuration Tests " )
66struct ConfigurationTests {
7-
87 @Test ( " Configuration requires at least one constraint " )
98 func testConfigurationRequiresConstraint( ) throws {
109 #expect( throws: ConfigurationError . noConstraints) {
@@ -22,7 +21,7 @@ struct ConfigurationTests {
2221
2322 @Test ( " Configuration accepts maxSize constraint " )
2423 func testConfigurationWithMaxSize( ) throws {
25- let config = try Configuration < String , String > ( maxSize: 1024 )
24+ let config = try Configuration < String , String > ( maxSize: 1_024 )
2625 #expect( config. max == nil )
2726 #expect( config. maxSize == 1024 )
2827 #expect( config. ttl == nil )
@@ -38,7 +37,7 @@ struct ConfigurationTests {
3837
3938 @Test ( " Configuration accepts multiple constraints " )
4039 func testConfigurationWithMultipleConstraints( ) throws {
41- let config = try Configuration < String , String > ( max: 100 , maxSize: 1024 , ttl: 300 )
40+ let config = try Configuration < String , String > ( max: 100 , maxSize: 1_024 , ttl: 300 )
4241 #expect( config. max == 100 )
4342 #expect( config. maxSize == 1024 )
4443 #expect( config. ttl == 300 )
@@ -111,7 +110,7 @@ struct ConfigurationTests {
111110
112111 @Test ( " Configuration accepts size calculation function " )
113112 func testConfigurationWithSizeCalculation( ) throws {
114- var config = try Configuration < String , Data > ( maxSize: 1024 )
113+ var config = try Configuration < String , Data > ( maxSize: 1_024 )
115114 config. sizeCalculation = { value, _ in
116115 value. count
117116 }
@@ -125,11 +124,13 @@ struct ConfigurationTests {
125124
126125 @Test ( " Configuration validates maxEntrySize " )
127126 func testConfigurationMaxEntrySize( ) throws {
128- var config = try Configuration < String , String > ( maxSize: 1024 )
127+ var config = try Configuration < String , String > ( maxSize: 1_024 )
129128 config. maxEntrySize = 512
130129
131130 #expect( config. maxEntrySize == 512 )
132- #expect( config. maxEntrySize! <= config. maxSize!)
131+ if let maxEntrySize = config. maxEntrySize, let maxSize = config. maxSize {
132+ #expect( maxEntrySize <= maxSize)
133+ }
133134 }
134135
135136 @Test ( " Configuration is a value type " )
@@ -142,4 +143,4 @@ struct ConfigurationTests {
142143 #expect( config1. ttl == nil )
143144 #expect( config2. ttl == 300 )
144145 }
145- }
146+ }
0 commit comments