<commit_before>//
//  GuitarRegexTests.swift
//  GuitarExample
//
//  Created by <NAME> on 3/9/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import XCTest
@testable import Guitar

class GuitarRegexTests: XCTestCase {

    func testEmailMatching() {
        XCTAssertEqual(GuitarRegex(pattern: GuitarPattern.email).evaluate(string: "This is one email addresses: <EMAIL>. This is another [<EMAIL>].").count, 2)
    }

    func testIsValidEmail() {
        XCTAssertTrue(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertTrue(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertFalse(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertFalse(GuitarRegex.isValidEmail(email: "arthur.sabintsev@x.y.z"))
    }

}<commit_msg>Added a couple more regex tests<commit_after>//
//  GuitarRegexTests.swift
//  GuitarExample
//
//  Created by <NAME> on 3/9/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import XCTest
@testable import Guitar

class GuitarRegexTests: XCTestCase {

    func testEmailMatching() {
        XCTAssertEqual(GuitarRegex(pattern: GuitarPattern.email).evaluate(string: "This is one email addresses: <EMAIL>. This is another [<EMAIL>].").count, 2)
    }

    func testAlphanumericMatching() {
        var string = "Hello World, and Hello Guitar Users! ^_^"
        let ranges = GuitarRegex(pattern: GuitarPattern.nonAlphanumeric).evaluate(string: string)

        XCTAssertEqual(ranges.count, 5)

        for range in ranges {
            string.replaceSubrange(range, with: "*")
        }

        XCTAssertEqual(string, "Hello World* and Hello Guitar Users* ***")
    }

    func testIsValidEmail() {
        XCTAssertTrue(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertTrue(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertFalse(GuitarRegex.isValidEmail(email: "<EMAIL>"))
        XCTAssertFalse(GuitarRegex.isValidEmail(email: "<EMAIL>.y.z"))
    }

}
{'fraction_non_alphanumeric': 0.13072568193515183, 'fraction_numerical': 0.00977869274318065, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '5321498', 'n_tokens_mistral': 660, 'n_tokens_neox': 623, 'n_words': 131}