"use strict";

var _vitest = require("vitest");
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); }
function testParser(parser, string) {
  var myStream = _index["default"].ofString(string);
  var parsing = parser.parse(myStream);
  return parsing;
}
(0, _vitest.describe)('Number Bundle Tests', function () {
  (0, _vitest.it)('expect N.integer() to be ok', function () {
    var string = '007';
    var parser = _index2.N.integer();
    var parsing = testParser(parser, string);
    (0, _vitest.expect)(parsing.value).toBe(7);
  });
  (0, _vitest.it)('expect N.integer() with sign to be ok', function () {
    var string = '-007';
    var parser = _index2.N.integer();
    var parsing = testParser(parser, string);
    (0, _vitest.expect)(parsing.value).toBe(-7);
  });
  (0, _vitest.it)('expect number without sign to be ok', function () {
    var string = '007.12';
    var parser = _index2.N.number();
    var parsing = testParser(parser, string);
    (0, _vitest.expect)(parsing.value).toBe(7.12);
  });
  (0, _vitest.it)('expect many digits to be joined and to be a number', function () {
    var string = '007';
    var parser = _index2.N.digits();
    var parsing = testParser(parser, string);
    (0, _vitest.expect)(_typeof(parsing.value)).toBe('number');
    (0, _vitest.expect)(parsing.value).toBe(7);
  });
});
//# sourceMappingURL=number-bundle-test.spec.js.map