"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _fs = _interopRequireDefault(require("fs"));
var _jsonparser = _interopRequireDefault(require("../../../lib/standard/json/jsonparser"));
var _index = _interopRequireDefault(require("../../../lib/stream/index"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/*
  ======== A Handy Little Nodeunit Reference ========
  https://github.com/caolan/nodeunit
  Test methods:
    test.expect(numAssertions)
    test.done()
  Test assertions:
    test.ok(value, [message])
    test.equal(actual, expected, [message])
    test.notEqual(actual, expected, [message])
    test.(actual, expected, [message])
    test.notDeepEqual(actual, expected, [message])
    test.strictEqual(actual, expected, [message])
    test.notStrictEqual(actual, expected, [message])
    test.throws(block, [error], [message])
    test.doesNotThrow(block, [error], [message])
    test.ifError(value)
*/

function sampleTest(sample, test) {
  test.expect(1);

  // tests here
  _fs["default"].readFile('./src/test/standard/json/samples/' + sample, function (err, data) {
    if (err) {
      throw err;
    }
    var result = {
      isAccepted: function isAccepted() {
        return false;
      }
    };
    try {
      result = _jsonparser["default"].parse(_index["default"].ofString(data.toString()));
    } catch (e) {
      console.log(e.stack);
    }
    if (!result.isAccepted()) {
      console.log(result);
    }
    test.ok(result.isAccepted(), 'Well formed JSON');
    test.done();
  });
}
var _default = exports["default"] = {
  setUp: function setUp(done) {
    done();
  },
  'test 1k': function test_1k(test) {
    sampleTest('1k.json', test);
  },
  'test 100k': function test_100k(test) {
    sampleTest('100k.json', test);
  }
};
//# sourceMappingURL=jsonsample_test.js.map