<commit_before>// run(graph, input) return (accept/reject, end state)

// each link will have a transition
// transition {
//   fromChar,
//   toChar, // empty string represents blank space character
//   direction // True is to the right, False is to the left
// }

function testHarness(graph, tests) {
  Object.keys(tests).forEach(function runTest(element, index, array) {
    var em = new Emulator(graph, element);
    em.run();
    console.log(element);
    console.log("Result: ", em.getTape(), " Expected: ", tests[element].result);
    console.log("Passes test?: ", em.getTape() === tests[element].result);
  });
}

// Test Set 1: Doubling the first character of the string. 
// Test: "0" => "00", Accept
// Test: "01" => "001", Accept
// Test: "10" => "110", Accept
// Test: "" => N/A, Reject
var test1 = {
  "0": {
    result: "00",
    accepted: true
  },<commit_msg>Update data spec in emulator_test_data.js<commit_after>// run(graph, input) return (accept/reject, end state)

// each link will have a transition
// transition {
//   fromChar,
//   toChar, // empty string represents blank space character
//   direction // True is to the right, False is to the left
// }

/*

graph specification:

{
  "nodes": [
    {
      "x": <int xloc>, // xloc is the x location of the node
      "y": <int yloc>, // yloc is the y location of the node
      "index": <int index>, // The indexing does not necessarily start from 0
      "name": <string name>,
      "selected": <boolean selected>
    }
  ],
  "links": [
    {
      "source": <int srcIndex>,
      "target": <int tgtIndex>,
      "transitions": [
        {
          "fromChar": <one character string>,
          "toChar": <one character string>,
          "direction": <boolean> // true indicates right
        }
      ]
    }
  ]
}

*/

function testHarness(graph, tests) {
  Object.keys(tests).forEach(function runTest(element, index, array) {
    var em = new Emulator(graph, element);
    em.run();
    console.log(element);
    console.log("Result: ", em.getTape(), " Expected: ", tests[element].result);
    console.log("Passes test?: ", em.getTape() === tests[element].result);
  });
}

// Test Set 1: Doubling the first character of the string. 
// Test: "0" => "00", Accept
// Test: "01" => "001", Accept
// Test: "10" => "110", Accept
// Test: "" => N/A, Reject
var test1 = {
  "0": {
    result: "00",
    accepted: true
  },
{'fraction_non_alphanumeric': 0.17054908485856904, 'fraction_numerical': 0.015391014975041598, 'mean_word_length': 2.7519500780031203, 'pattern_counts': {'":': 15, '<': 13, '<?xml version=': 0, '>': 21, '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': '7352146', 'n_tokens_mistral': 790, 'n_tokens_neox': 770, 'n_words': 241}