<commit_before>//
//  AttributeTests.swift
//  QueryKit
//
//  Created by <NAME> on 19/06/2014.
//
//

import XCTest
import QueryKit

class AttributeTests: XCTestCase {
    var attribute:Attribute<Int>!

    override func setUp() {
        super.setUp()

        attribute = Attribute("age")
    }
    
    func testAttributeHasName() {
        XCTAssertEqual(attribute.name, "age")
    }

    func testAttributeExpression() {
        XCTAssertEqual(attribute.expression.keyPath!, "age")
    }

    func testEqualAttributesAreEquatable() {
        XCTAssertEqual(attribute, Attribute<Int>("age"))
    }

    func testCompoundAttributeCreation() {
        let personCompanyNameAttribute = Attribute<NSString>(attributes:["company", "name"])

        XCTAssertEqual(personCompanyNameAttribute.name, "company.name")
        XCTAssertEqual(personCompanyNameAttribute.expression.keyPath!, "company.name")
    }

    // Sorting

    func testAscendingSortDescriptor() {
        XCTAssertEqual(attribute.ascending(), NSSortDescriptor(key: "age", ascending: true))
    }

    func testDescendingSortDescriptor() {
        XCTAssertEqual(attribute.descending(), NSSortDescriptor(key: "age", ascending: false))
    }

    // Operators

    func testEqualityOperator() {
        var predicate:NSPredicate = (attribute == 10)
        XCTAssertEqual(predicate, NSPredicate(format:"age == 10"))
    }
<commit_msg>Update to beta 6<commit_after>//
//  AttributeTests.swift
//  QueryKit
//
//  Created by <NAME> on 19/06/2014.
//
//

import XCTest
import QueryKit

class AttributeTests: XCTestCase {
    var attribute:Attribute<Int>!

    override func setUp() {
        super.setUp()

        attribute = Attribute("age")
    }
    
    func testAttributeHasName() {
        XCTAssertEqual(attribute.name, "age")
    }

    func testAttributeExpression() {
        XCTAssertEqual(attribute.expression.keyPath, "age")
    }

    func testEqualAttributesAreEquatable() {
        XCTAssertEqual(attribute, Attribute<Int>("age"))
    }

    func testCompoundAttributeCreation() {
        let personCompanyNameAttribute = Attribute<NSString>(attributes:["company", "name"])

        XCTAssertEqual(personCompanyNameAttribute.name, "company.name")
        XCTAssertEqual(personCompanyNameAttribute.expression.keyPath, "company.name")
    }

    // Sorting

    func testAscendingSortDescriptor() {
        XCTAssertEqual(attribute.ascending(), NSSortDescriptor(key: "age", ascending: true))
    }

    func testDescendingSortDescriptor() {
        XCTAssertEqual(attribute.descending(), NSSortDescriptor(key: "age", ascending: false))
    }

    // Operators

    func testEqualityOperator() {
        var predicate:NSPredicate = (attribute == 10)
        XCTAssertEqual(predicate, NSPredicate(format:"age == 10"))
    }

{'fraction_non_alphanumeric': 0.11861379063951412, 'fraction_numerical': 0.008931761343336906, 'mean_word_length': 3.268292682926829, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7129938', 'n_tokens_mistral': 851, 'n_tokens_neox': 795, 'n_words': 143}