regex-quantifiers.js 908 B

12345678910111213141516171819
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. var tests = [
  7. {
  8. name: 'Quantifier characters shouldn\'t be allowed on their own',
  9. body: function () {
  10. assert.throws(function () { eval('/*/'); }, SyntaxError, '/*/');
  11. assert.throws(function () { eval('/+/'); }, SyntaxError, '/+/');
  12. assert.throws(function () { eval('/?/'); }, SyntaxError, '/?/');
  13. }
  14. }
  15. ];
  16. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != 'summary' });