| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 RegExpCompileData result; | 401 RegExpCompileData result; |
| 402 CHECK(!v8::internal::RegExpParser::ParseRegExp( | 402 CHECK(!v8::internal::RegExpParser::ParseRegExp( |
| 403 &reader, false, &result, &zone)); | 403 &reader, false, &result, &zone)); |
| 404 CHECK(result.tree == NULL); | 404 CHECK(result.tree == NULL); |
| 405 CHECK(!result.error.is_null()); | 405 CHECK(!result.error.is_null()); |
| 406 SmartArrayPointer<char> str = result.error->ToCString(ALLOW_NULLS); | 406 SmartArrayPointer<char> str = result.error->ToCString(ALLOW_NULLS); |
| 407 CHECK_EQ(expected, *str); | 407 CHECK_EQ(expected, *str); |
| 408 } | 408 } |
| 409 | 409 |
| 410 | 410 |
| 411 UNINITIALIZED_TEST(Errors) { | 411 TEST(Errors) { |
| 412 V8::Initialize(NULL); | |
| 413 const char* kEndBackslash = "\\ at end of pattern"; | 412 const char* kEndBackslash = "\\ at end of pattern"; |
| 414 ExpectError("\\", kEndBackslash); | 413 ExpectError("\\", kEndBackslash); |
| 415 const char* kUnterminatedGroup = "Unterminated group"; | 414 const char* kUnterminatedGroup = "Unterminated group"; |
| 416 ExpectError("(foo", kUnterminatedGroup); | 415 ExpectError("(foo", kUnterminatedGroup); |
| 417 const char* kInvalidGroup = "Invalid group"; | 416 const char* kInvalidGroup = "Invalid group"; |
| 418 ExpectError("(?", kInvalidGroup); | 417 ExpectError("(?", kInvalidGroup); |
| 419 const char* kUnterminatedCharacterClass = "Unterminated character class"; | 418 const char* kUnterminatedCharacterClass = "Unterminated character class"; |
| 420 ExpectError("[", kUnterminatedCharacterClass); | 419 ExpectError("[", kUnterminatedCharacterClass); |
| 421 ExpectError("[a-", kUnterminatedCharacterClass); | 420 ExpectError("[a-", kUnterminatedCharacterClass); |
| 422 const char* kNothingToRepeat = "Nothing to repeat"; | 421 const char* kNothingToRepeat = "Nothing to repeat"; |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 ZoneList<CharacterRange> first_only(4, &zone); | 1816 ZoneList<CharacterRange> first_only(4, &zone); |
| 1818 ZoneList<CharacterRange> second_only(4, &zone); | 1817 ZoneList<CharacterRange> second_only(4, &zone); |
| 1819 ZoneList<CharacterRange> both(4, &zone); | 1818 ZoneList<CharacterRange> both(4, &zone); |
| 1820 } | 1819 } |
| 1821 | 1820 |
| 1822 | 1821 |
| 1823 TEST(Graph) { | 1822 TEST(Graph) { |
| 1824 V8::Initialize(NULL); | 1823 V8::Initialize(NULL); |
| 1825 Execute("\\b\\w+\\b", false, true, true); | 1824 Execute("\\b\\w+\\b", false, true, true); |
| 1826 } | 1825 } |
| OLD | NEW |