<commit_before>
import XCTest
@testable import numsw

class NDArrayBoolTests: XCTestCase {
    
    func testBool() {
        let a = NDArray(shape: [2, 2], elements: [true, false, true, false])
        let b = NDArray(shape: [2, 2], elements: [true, true, false, false])
        
        XCTAssertEqual(!a, NDArray(shape: [2, 2], elements: [false, true, false, true]))
        XCTAssertEqual(a && b, NDArray(shape: [2, 2], elements: [true, false, false, false]))
        XCTAssertEqual(a || b, NDArray(shape: [2, 2], elements: [true, true, true, false]))
    }
    
    func testCompare() {
        let a = NDArray(shape: [2, 2], elements: [1, 2, 3, 4])
        let b = NDArray(shape: [2, 2], elements: [1, 3, 2, 4])
        
        XCTAssertEqual(a == 2, NDArray(shape: [2, 2], elements: [false, true, false, false]))
        XCTAssertEqual(a < 2, NDArray(shape: [2, 2], elements: [true, false, false, false]))
        XCTAssertEqual(a > 3, NDArray(shape: [2, 2], elements: [false, false, false, true]))
        XCTAssertEqual(a <= 2, NDArray(shape: [2, 2], elements: [true, true, false, false]))
        XCTAssertEqual(a >= 3, NDArray(shape: [2, 2], elements: [false, false, true, true]))
        
        XCTAssertEqual(a == b, NDArray(shape: [2, 2], elements: [true, false, false, true]))
        XCTAssertEqual(a < b, NDArray(shape: [2, 2], elements: [false, true, false, false]))
        XCTAssertEqual(a > b, NDArray(shape: [2, 2], elements: [false, false, true, false]))
        XCTAssertEqual(a <= b, NDArray(shape: [2, 2], elements: [true, true, false, true]))
        XCTAssertEqual(a >= b, NDArray(shape: [2, 2], elements: [true, false, true, true]))
    }
}<commit_msg>Change NDArrayBoolTests<commit_after>
import XCTest
@testable import numsw

class NDArrayBoolTests: XCTestCase {
    
    func testBool() {
        let a = NDArray(shape: [2, 2], elements: [true, false, true, false])
        let b = NDArray(shape: [2, 2], elements: [true, true, false, false])
        
        XCTAssertEqual(not(a), NDArray(shape: [2, 2], elements: [false, true, false, true]))
        XCTAssertEqual(and(a, b), NDArray(shape: [2, 2], elements: [true, false, false, false]))
        XCTAssertEqual(or(a, b), NDArray(shape: [2, 2], elements: [true, true, true, false]))
    }
    
    func testCompare() {
        let a = NDArray(shape: [2, 2], elements: [1, 2, 3, 4])
        let b = NDArray(shape: [2, 2], elements: [1, 3, 2, 4])
        
        XCTAssertEqual(equal(a, 2), NDArray(shape: [2, 2], elements: [false, true, false, false]))
        XCTAssertEqual(lessThan(a, 2), NDArray(shape: [2, 2], elements: [true, false, false, false]))
        XCTAssertEqual(greaterThan(a, 3), NDArray(shape: [2, 2], elements: [false, false, false, true]))
        XCTAssertEqual(notGreaterThan(a, 2), NDArray(shape: [2, 2], elements: [true, true, false, false]))
        XCTAssertEqual(notLessThan(a, 3), NDArray(shape: [2, 2], elements: [false, false, true, true]))
        
        XCTAssertEqual(equal(a, b), NDArray(shape: [2, 2], elements: [true, false, false, true]))
        XCTAssertEqual(lessThan(a, b), NDArray(shape: [2, 2], elements: [false, true, false, false]))
        XCTAssertEqual(greaterThan(a, b), NDArray(shape: [2, 2], elements: [false, false, true, false]))
        XCTAssertEqual(notGreaterThan(a, b), NDArray(shape: [2, 2], elements: [true, true, false, true]))
        XCTAssertEqual(notLessThan(a, b), NDArray(shape: [2, 2], elements: [true, false, true, true]))
    }
}
{'fraction_non_alphanumeric': 0.176841501862998, 'fraction_numerical': 0.02694181713958154, 'mean_word_length': 3.497422680412371, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3429685', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1209, 'n_words': 365}