@@ -21,6 +21,7 @@ class TestNSString : XCTestCase {
2121
2222 var allTests : [ ( String , ( ) -> ( ) ) ] {
2323 return [
24+ ( " test_boolValue " , test_boolValue ) ,
2425 ( " test_BridgeConstruction " , test_BridgeConstruction ) ,
2526 ( " test_isEqualToStringWithSwiftString " , test_isEqualToStringWithSwiftString ) ,
2627 ( " test_isEqualToObjectWithNSString " , test_isEqualToObjectWithNSString ) ,
@@ -37,6 +38,17 @@ class TestNSString : XCTestCase {
3738 ( " test_rangeOfCharacterFromSet " , test_rangeOfCharacterFromSet ) ,
3839 ]
3940 }
41+
42+ func test_boolValue( ) {
43+ let trueStrings : [ NSString ] = [ " t " , " true " , " TRUE " , " tRuE " , " yes " , " YES " , " 1 " , " +000009 " ]
44+ for string in trueStrings {
45+ XCTAssert ( string. boolValue)
46+ }
47+ let falseStrings : [ NSString ] = [ " false " , " FALSE " , " fAlSe " , " no " , " NO " , " 0 " , " <true> " , " _true " , " -00000 " ]
48+ for string in falseStrings {
49+ XCTAssertFalse ( string. boolValue)
50+ }
51+ }
4052
4153 func test_BridgeConstruction( ) {
4254 let literalConversion : NSString = " literal "
0 commit comments