<commit_before>//
// FileHandle_Tests.swift
// SwiftShell
//
// Created by <NAME> on 19/08/14.
// Copyright (c) 2014 NotTooBad Software. All rights reserved.
//

import SwiftShell
import XCTest

extension XCTestCase {
	
	func pathForTestResource (filename: String, type: String) -> String {
		let path = NSBundle(forClass: self.dynamicType).pathForResource(filename, ofType: type) 
		assert(path != nil, "resource \(filename).\(type) not found") 
		
		return path!
	}
}

class FileHandle_Tests: XCTestCase {

	// waiting for error handling to be implemented
	func notestOpenForReadingFileWhichDoesNotExist() {
		let file = open("file which does not exist")
		XCTFail("not implemented yet")
	}
	
	func testReadFileLineByLine() {
		let shorttextpath = pathForTestResource("shorttext", type: "txt")
		var contents = ""
		
		for line in open(shorttextpath).lines() {
			contents.write(line)
		}
		
		XCTAssertFalse(contents.isEmpty)
	}
}<commit_msg>Add assertion to test.<commit_after>//
// FileHandle_Tests.swift
// SwiftShell
//
// Created by <NAME> on 19/08/14.
// Copyright (c) 2014 NotTooBad Software. All rights reserved.
//

import SwiftShell
import XCTest

extension XCTestCase {
	
	func pathForTestResource (filename: String, type: String) -> String {
		let path = NSBundle(forClass: self.dynamicType).pathForResource(filename, ofType: type) 
		assert(path != nil, "resource \(filename).\(type) not found") 
		
		return path!
	}
}

class FileHandle_Tests: XCTestCase {

	// waiting for error handling to be implemented
	func notestOpenForReadingFileWhichDoesNotExist() {
		let file = open("file which does not exist")
		XCTFail("not implemented yet")
	}
	
	func testReadFileLineByLine() {
		let shorttextpath = pathForTestResource("shorttext", type: "txt")
		var contents = ""
		
		for line in open(shorttextpath).lines() {
			contents.write(line)
		}
		

	}
}
{'fraction_non_alphanumeric': 0.11689008042895442, 'fraction_numerical': 0.010723860589812333, 'mean_word_length': 4.016129032258065, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4136955', 'n_tokens_mistral': 658, 'n_tokens_neox': 576, 'n_words': 162}