"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _index = _interopRequireDefault(require("../../lib/stream/index"));
var _index2 = require("../../lib/parsec/index");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
var value = undefined;
function testParser(parser, string) {
  var myStream = _index["default"].ofString(string);
  var parsing = parser.parse(myStream);
  value = parsing.value;
}
var _default = exports["default"] = {
  setUp: function setUp(done) {
    done();
  },
  'expect N.integer() to be ok': function expect_NInteger_to_be_ok(test) {
    var string = '007';
    // tests here
    var parser = _index2.N.integer();
    testParser(parser, string);
    test.equal(value, 7, 'N.integer()');
    test.done();
  },
  'expect N.integer() with sign to be ok': function expect_NInteger_with_sign_to_be_ok(test) {
    var string = '-007';
    // tests here
    var parser = _index2.N.integer();
    testParser(parser, string);
    test.equal(value, -7, 'negative N.integer()');
    test.done();
  },
  'expect number without sign to be ok': function expect_number_without_sign_to_be_ok(test) {
    var string = '007.12';
    // tests here
    var parser = _index2.N.number();
    testParser(parser, string);
    test.equal(value, 7.12, 'number');
    test.done();
  },
  'expect many digits to be joined and to be a number': function expect_many_digits_to_be_joined_and_to_be_a_number(test) {
    var string = '007';
    // tests here
    var parser = _index2.N.digits();
    testParser(parser, string);
    test.equal(_typeof(value), 'number', 'N.digits() should be a string');
    test.equal(value, 7, 'N.digits() returns a bad value');
    test.done();
  }
};
//# sourceMappingURL=number-bundle-test.js.map