isCodePoint.js 590 B

1234567891011121314151617181920
  1. 'use strict';
  2. var test = require('tape');
  3. var forEach = require('foreach');
  4. var debug = require('object-inspect');
  5. var isCodePoint = require('../../helpers/isCodePoint');
  6. var v = require('es-value-fixtures');
  7. test('isCodePoint', function (t) {
  8. forEach(v.notNonNegativeIntegers.concat(0x10FFFF + 1), function (nonCodePoints) {
  9. t.equal(isCodePoint(nonCodePoints), false, debug(nonCodePoints) + ' is not a Code Point');
  10. });
  11. forEach([-0, 0, 1, 7, 42, 0x10FFFF], function (codePoint) {
  12. t.equal(isCodePoint(codePoint), true, debug(codePoint) + ' is a Code Point');
  13. });
  14. t.end();
  15. });