<commit_before>//
//  FileLoadingTests.swift
//  FileLoadingTests
//
//  Created by <NAME> on 21/11/2015.
//  Copyright © 2015 <NAME> All rights reserved.
//

import XCTest
@testable import JSONUtilities

typealias NoEscapeFunction = ( () throws -> Void)

class FileLoadingTests: XCTestCase {
  
//  func testLoadFromBundle() {
//    do {
//      let _ = try JSONDictionary.from(filename: JSONFilename.correct, bundle: testBundle)
//    } catch {
//      XCTFail("Unexpected error: \(error)")
//    }
//  }
//  
//  func testAttemptToLoadMissingFileFromBundle() {
//    do {
//      let _ = try JSONDictionary.from(filename: JSONFilename.missing, bundle: testBundle)
//    } catch let error as JSONUtilsError {
//      XCTAssertEqual(error, JSONUtilsError.couldNotFindFile)
//    } catch {
//      XCTFail("Unexpected error: \(error)")
//    }
//  }
  
  func testLoadingJSONFile() {
    do {
      try JSONDictionary.from(url: JSONFilePath.correct)
    } catch {
      XCTFail("Unexpected error: \(error)")
    }
  }
  
  func testLoadingJSONFileLoadingFailed() {
    expectError(.fileLoadingFailed) {
      try JSONDictionary.from(url: JSONFilePath.missing)
    }
  }
  
  func testLoadingJSONFileDeserializationFailed() {
    expectError(.fileDeserializationFailed) {
      try JSONDictionary.from(url: JSONFilePath.invalid)
    }
  }<commit_msg>Removed commented tests that are now in BundleFileLoadingTests file<commit_after>//
//  FileLoadingTests.swift
//  FileLoadingTests
//
//  Created by <NAME> on 21/11/2015.
//  Copyright © 2015 <NAME> All rights reserved.
//

import XCTest
@testable import JSONUtilities

typealias NoEscapeFunction = ( () throws -> Void)

class FileLoadingTests: XCTestCase {
  
  func testLoadingJSONFile() {
    do {
      try JSONDictionary.from(url: JSONFilePath.correct)
    } catch {
      XCTFail("Unexpected error: \(error)")
    }
  }
  
  func testLoadingJSONFileLoadingFailed() {
    expectError(.fileLoadingFailed) {
      try JSONDictionary.from(url: JSONFilePath.missing)
    }
  }
  
  func testLoadingJSONFileDeserializationFailed() {
    expectError(.fileDeserializationFailed) {
      try JSONDictionary.from(url: JSONFilePath.invalid)
    }
  }
{'fraction_non_alphanumeric': 0.11845102505694761, 'fraction_numerical': 0.010933940774487472, 'mean_word_length': 3.089385474860335, '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': '5099537', 'n_tokens_mistral': 699, 'n_tokens_neox': 669, 'n_words': 139}