<commit_before>//
//  OperatorTests.swift
//  Cartography
//
//  Created by <NAME> on 18/06/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Cartography
import XCTest

class OperatorTests: XCTestCase {
    var superview: View!
    var view: View!

    override func setUp() {
        superview = View(frame: CGRectMake(0, 0, 200, 200))

        view = View(frame: CGRectZero)
        superview.addSubview(view)
    }

    func testAddition() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width + 100
        }

        XCTAssert(constraint.constant == 100, "It should set the constant")
    }

    func testSubtraction() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width - 100
        }

        XCTAssert(constraint.constant == -100, "It should set the constant")
    }

    func testMultiplication() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == (view.superview!.width + 100) * 2 + 5
        }

        XCTAssert(constraint.multiplier == 2, "It should set the constant")
        XCTAssert(constraint.constant == 205, "It should multiply the constant")
    }

    func testDivision() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == (view.superview!.width + 100) / 2 + 5
        }

        XCTAssert(constraint.multiplier == 0.5, "It should set the constant")
        XCTAssert(constraint.constant == 55, "It should divide the constant")
    }

    func testDivision2() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width / 2
        }

        XCTAssert(constraint.multiplier == 0.5, "It should set the constant")
    }

    func testPriority() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = (view.width == 200 ~ 100)
        }

        XCTAssert(constraint.priority == 100, "It should set the priority")
    }
<commit_msg>Circumvent 'too complex' expressions<commit_after>//
//  OperatorTests.swift
//  Cartography
//
//  Created by <NAME> on 18/06/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

import Cartography
import XCTest

class OperatorTests: XCTestCase {
    var superview: View!
    var view: View!

    override func setUp() {
        superview = View(frame: CGRectMake(0, 0, 200, 200))

        view = View(frame: CGRectZero)
        superview.addSubview(view)
    }

    func testAddition() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width + 100
        }

        XCTAssert(constraint.constant == 100, "It should set the constant")
    }

    func testSubtraction() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width - 100
        }

        XCTAssert(constraint.constant == -100, "It should set the constant")
    }

    func testMultiplication() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == (view.superview!.width + 100) * 2 + 5; return
        }

        XCTAssert(constraint.multiplier == 2, "It should set the constant")
        XCTAssert(constraint.constant == 205, "It should multiply the constant")
    }

    func testDivision() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == (view.superview!.width + 100) / 2 + 5; return
        }

        XCTAssert(constraint.multiplier == 0.5, "It should set the constant")
        XCTAssert(constraint.constant == 55, "It should divide the constant")
    }

    func testDivision2() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = view.width == view.superview!.width / 2
        }

        XCTAssert(constraint.multiplier == 0.5, "It should set the constant")
    }

    func testPriority() {
        var constraint: NSLayoutConstraint!

        layout(view) { view in
            constraint = (view.width == 200 ~ 100)
        }

        XCTAssert(constraint.priority == 100, "It should set the priority")
    }

{'fraction_non_alphanumeric': 0.10763341589732042, 'fraction_numerical': 0.027471290249943707, 'mean_word_length': 2.237609329446064, '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': '5983733', 'n_tokens_mistral': 1393, 'n_tokens_neox': 1225, 'n_words': 351}