<commit_before><commit_msg>Added Colon Space Linter. Added unit tests. Tests passing<commit_after>//
//  Tests.swift
//  Tests
//
//  Created by <NAME> on 9/15/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import XCTest
@testable import LinterExt

class SpacerTests: XCTestCase {
    
    func testThat_ColonFollowedByNoSpace_IsReplaced() {
        let testInputLine = "let a:String?"
        let expectedOutput = "let a: String?"
        
        let output = LintSpace().ensureOneSpaceAfterColon(line: testInputLine)
        
        XCTAssertEqual(expectedOutput, output)
    }
    
    func testThat_ColonFollowedByMoreSpace_IsReplaced() {
        let testInputLines = ["let a:   Int", "let b:              String?", "[String:  AnyObject]"]
        let expectedOutputs = ["let a: Int", "let b: String?", "[String: AnyObject]"]
        
        let outputs = testInputLines.map({ LintSpace().ensureOneSpaceAfterColon(line: $0) })
        
        XCTAssertEqual(expectedOutputs, outputs)
    }
    
    func testThat_ColonFollowedByOneSpace_IsReturnedSame() {
        let inputs = ["let a: Int", "func do(a: Int, b: [String: AnyObject]) {"]
        
        let outputs = inputs.map{ LintSpace().ensureOneSpaceAfterColon(line: $0) }
        
        XCTAssertEqual(inputs, outputs)
    }
    
}
{'fraction_non_alphanumeric': 0.11535523300229182, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 2.669467787114846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2109978', 'n_tokens_mistral': 420, 'n_tokens_neox': 405, 'n_words': 97}