Sha256: bcf7c4cfb20eb76be199df0e4de02dd55b0f0924f2310262d9dc6fbce2e8ca28

Contents?: true

Size: 1.97 KB

Versions: 262

Compression:

Stored size: 1.97 KB

Contents

#import <XCTest/XCTest.h>
#if __has_include("BracketPushExample.h")
# import "BracketPushExample.h"
# else
# import "BracketPush.h"
#endif
@interface BracketPushTest : XCTestCase

@end

@implementation BracketPushTest

- (void)testPairedSquareBrackets {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"[]"]);
}

- (void)testEmptyString {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@""]);
}

- (void)testUnpairedBrackets {
    XCTAssertFalse([BracketPushExample validateBracketPairingAndNestingInString:@"[["]);
}

- (void)testWrongOrderedBrackets {
    XCTAssertFalse([BracketPushExample validateBracketPairingAndNestingInString:@"}{"]);
}

- (void)testPairedWithWhitespace {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"{ }"]);
}

- (void)testSimpleNestedBrackets {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"{[]}"]);
}

- (void)testSeveralPairedBrackets {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"{}[]"]);
}

- (void)testPairedAndNestedBrackets {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"([{}({}[])])"]);
}

- (void)testUnopenedClosingBrackets {
    XCTAssertFalse([BracketPushExample validateBracketPairingAndNestingInString:@"{[)][]}"]);
}

- (void)testUnpairedAndNestedBrackets {
    XCTAssertFalse([BracketPushExample validateBracketPairingAndNestingInString:@"([{])"]);
}

- (void)testPairedAndWrongNestedBrackets {
    XCTAssertFalse([BracketPushExample validateBracketPairingAndNestingInString:@"[({]})"]);
}

- (void)testMathExpression {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"(((185 + 223.85) * 15) - 543)/2"]);
}

- (void)testComplexLatexExpression {
    XCTAssertTrue([BracketPushExample validateBracketPairingAndNestingInString:@"\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"]);
}
@end

Version data entries

262 entries across 262 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.138 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.137 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.136 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.135 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.134 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.133 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.132 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.131 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.130 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.129 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.128 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.127 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.126 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.125 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.124 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.123 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.122 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.121 tracks/objective-c/exercises/bracket-push/BracketPushTest.m
trackler-2.2.1.120 tracks/objective-c/exercises/bracket-push/BracketPushTest.m