<commit_before>//
//  SwiftBoxTests.swift
//  SwiftBoxTests
//
//  Created by <NAME> on 2/1/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Cocoa
import XCTest
import SwiftBox

class SwiftBoxTests: XCTestCase {
    func testDescription() {
		let parent = Node(size: CGSize(width: 300, height: 300),
                    childAlignment: .Center,
					direction: .Row,
                    children: [
			Node(flex: 75,
                 margin: Edges(left: 10, right: 10),
                 size: CGSize(width: 0, height: 100)),
			Node(flex: 15,
				 margin: Edges(right: 10),
                 size: CGSize(width: 0, height: 50)),
			Node(flex: 10,
				 margin: Edges(right: 10),
				 size: CGSize(width: 0, height: 180)),
		])

		let layout = parent.layout()
		XCTAssert("\(layout)".utf16Count > 0, "Has a description.")
    }

	func testSizeParentBasedOnChildren() {
		let parent = Node(children: [
			Node(size: CGSize(width: 100, height: 200)),<commit_msg>More Swift 1.2 changes.<commit_after>//
//  SwiftBoxTests.swift
//  SwiftBoxTests
//
//  Created by <NAME> on 2/1/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import Cocoa
import XCTest
import SwiftBox

class SwiftBoxTests: XCTestCase {
    func testDescription() {
		let parent = Node(size: CGSize(width: 300, height: 300),
                    childAlignment: .Center,
					direction: .Row,
                    children: [
			Node(flex: 75,
                 margin: Edges(left: 10, right: 10),
                 size: CGSize(width: 0, height: 100)),
			Node(flex: 15,
				 margin: Edges(right: 10),
                 size: CGSize(width: 0, height: 50)),
			Node(flex: 10,
				 margin: Edges(right: 10),
				 size: CGSize(width: 0, height: 180)),
		])

		let layout = parent.layout()
		XCTAssert(count("\(layout)".utf16) > 0, "Has a description.")
    }

	func testSizeParentBasedOnChildren() {
		let parent = Node(children: [
			Node(size: CGSize(width: 100, height: 200)),
{'fraction_non_alphanumeric': 0.14169215086646278, 'fraction_numerical': 0.04994903160040775, 'mean_word_length': 2.4681978798586575, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4604883', 'n_tokens_mistral': 802, 'n_tokens_neox': 621, 'n_words': 178}