<commit_before>//
//  UtilityErrorTests.swift
//  Noonian
//
//  Created by <NAME> on 11/7/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import NoonianKit

class NoonianKitErrorTests: XCTestCase {
    func testNSErrorHasExplanation() {
        let error = NSError(domain: "com.test", code: 0, userInfo: [NSLocalizedDescriptionKey: "explanation"])
        XCTAssertEqual(error.explanation, "explanation")
    }

    func testWrappedUtilityError() {
        let error = NoonianKitError.internalError(UtilityError.taskFailed(taskName: "task", command: "command"))
        XCTAssertEqual(error.explanation, "task failed at command: command")
    }
}

#if os(Linux)
    extension NoonianKitErrorTests {
        static var allTests = [
            ("testNSErrorHasExplanation", testNSErrorHasExplanation),
            ("testWrappedUtilityError", testWrappedUtilityError),
        ]
    }
#endif<commit_msg>Fix Linux tests.<commit_after>//
//  UtilityErrorTests.swift
//  Noonian
//
//  Created by <NAME> on 11/7/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import XCTest
@testable import NoonianKit

class NoonianKitErrorTests: XCTestCase {
    func testNSErrorHasExplanation() {
        let error = NSError(domain: "com.test", code: 0, userInfo: [NSLocalizedDescriptionKey: "explanation"])
        XCTAssertEqual(error.explanation, "explanation")
    }

    func testWrappedUtilityError() {
        let error = NoonianKitError.internalError(UtilityError.taskFailed(taskName: "task", command: "command"))
        XCTAssertEqual(error.explanation, "task failed at command: command")
    }
}

#if os(Linux)
    extension NoonianKitErrorTests {
        static var allTests = [
            ("testNSErrorHasExplanation", testNSErrorHasExplanation),
            ("testWrappedUtilityError", testWrappedUtilityError),
        ]
    }
#endif
{'fraction_non_alphanumeric': 0.1104067617538299, 'fraction_numerical': 0.010565240359218173, 'mean_word_length': 3.4669811320754715, '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': '531429', 'n_tokens_mistral': 622, 'n_tokens_neox': 575, 'n_words': 127}