<commit_before>var sys = require("sys");
var path = require("path");
var assert = require("assert");
var plist = require("../lib/plist");

// The Plist file to parse...
var file = path.join(__dirname, "iTunes-small.xml");

var startTime = new Date();

plist.parseFile(file, function(err, dicts) {

  if (err) {
    throw err;
  }

  var endTime = new Date();
  sys.puts('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms');

  sys.puts(sys.inspect(dicts, true, 5));
  //sys.puts(JSON.stringify(dicts));
  
  var dict = dicts[0];
  //assert.equal(dict['Application Version'], "9.0.3");
  //assert.equal(dict['Library Persistent ID'], "6F81D37F95101437");
  
});

var plistFile = path.join(__dirname, "tests/sample2.plist");

plist.parseFile(plistFile, function(err, dicts) {
  if (err) {
    throw err;
  }

  var dict = dicts[0];

  assert.equal(dict['PopupMenu'][2]['Key'], "\n        #import &lt;Cocoa/Cocoa.h&gt;\n\n#import &lt;MacRuby/MacRuby.h&gt;\n\nint main(int argc, char *argv[])\n{\n  return macruby_main(\"rb_main.rb\", argc, argv);\n}\n");
});
<commit_msg>Better test case. Replace `sys.puts()` with `console.log()`.<commit_after>var path = require("path");
var assert = require("assert");
var plist = require("../");

// First test...
var file = path.join(__dirname, "iTunes-small.xml");
var startTime1 = new Date();

plist.parseFile(file, function(err, dicts) {
  if (err) {
    throw err;
  }

  var endTime = new Date();
  console.log('Parsed "' + file + '" in ' + (endTime - startTime1) + 'ms');

  var dict = dicts[0];
  assert.equal(dict['Application Version'], "9.0.3");
  assert.equal(dict['Library Persistent ID'], "6F81D37F95101437");

});


// Second tests. Runs concurrently with the first test...
var file2 = path.join(__dirname, "sample2.plist");
var startTime2 = new Date();

plist.parseFile(file2, function(err, dicts) {
  if (err) {
    throw err;
  }

  var endTime = new Date();
  console.log('Parsed "' + file2 + '" in ' + (endTime - startTime2) + 'ms');

  var dict = dicts[0];
  assert.equal(dict['PopupMenu'][2]['Key'], "\n        #import &lt;Cocoa/Cocoa.h&gt;\n\n#import &lt;MacRuby/MacRuby.h&gt;\n\nint main(int argc, char *argv[])\n{\n  return macruby_main(\"rb_main.rb\", argc, argv);\n}\n");

});

{'fraction_non_alphanumeric': 0.2071269487750557, 'fraction_numerical': 0.021380846325167038, 'mean_word_length': 3.882608695652174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5780504', 'n_tokens_mistral': 878, 'n_tokens_neox': 831, 'n_words': 184}