| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 TEST_CASE(TokenStream) { | 145 TEST_CASE(TokenStream) { |
| 146 String& source = String::Handle(String::New("= ( 9 , .")); | 146 String& source = String::Handle(String::New("= ( 9 , .")); |
| 147 String& private_key = String::Handle(String::New("")); | 147 String& private_key = String::Handle(String::New("")); |
| 148 Scanner scanner(source, private_key); | 148 Scanner scanner(source, private_key); |
| 149 const Scanner::GrowableTokenStream& ts = scanner.GetStream(); | 149 const Scanner::GrowableTokenStream& ts = scanner.GetStream(); |
| 150 EXPECT_EQ(6, ts.length()); | 150 EXPECT_EQ(6, ts.length()); |
| 151 EXPECT_EQ(Token::kLPAREN, ts[1].kind); | 151 EXPECT_EQ(Token::kLPAREN, ts[1].kind); |
| 152 const TokenStream& token_stream = TokenStream::Handle(TokenStream::New(ts)); | 152 const TokenStream& token_stream = TokenStream::Handle( |
| 153 TokenStream::New(ts, private_key)); |
| 153 TokenStream::Iterator iterator(token_stream, 0); | 154 TokenStream::Iterator iterator(token_stream, 0); |
| 154 // EXPECT_EQ(6, token_stream.Length()); | 155 // EXPECT_EQ(6, token_stream.Length()); |
| 155 iterator.Advance(); // Advance to '(' token. | 156 iterator.Advance(); // Advance to '(' token. |
| 156 EXPECT_EQ(Token::kLPAREN, iterator.CurrentTokenKind()); | 157 EXPECT_EQ(Token::kLPAREN, iterator.CurrentTokenKind()); |
| 157 iterator.Advance(); | 158 iterator.Advance(); |
| 158 iterator.Advance(); | 159 iterator.Advance(); |
| 159 iterator.Advance(); // Advance to '.' token. | 160 iterator.Advance(); // Advance to '.' token. |
| 160 EXPECT_EQ(Token::kPERIOD, iterator.CurrentTokenKind()); | 161 EXPECT_EQ(Token::kPERIOD, iterator.CurrentTokenKind()); |
| 161 iterator.Advance(); // Advance to end of stream. | 162 iterator.Advance(); // Advance to end of stream. |
| 162 EXPECT_EQ(Token::kEOS, iterator.CurrentTokenKind()); | 163 EXPECT_EQ(Token::kEOS, iterator.CurrentTokenKind()); |
| (...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 | 2805 |
| 2805 | 2806 |
| 2806 TEST_CASE(ArrayNew_Overflow_Crash) { | 2807 TEST_CASE(ArrayNew_Overflow_Crash) { |
| 2807 Array::Handle(Array::New(Array::kMaxElements + 1)); | 2808 Array::Handle(Array::New(Array::kMaxElements + 1)); |
| 2808 } | 2809 } |
| 2809 | 2810 |
| 2810 | 2811 |
| 2811 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 2812 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 2812 | 2813 |
| 2813 } // namespace dart | 2814 } // namespace dart |
| OLD | NEW |