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 "platform/json.h" | 6 #include "platform/json.h" |
7 #include "vm/json_stream.h" | 7 #include "vm/json_stream.h" |
8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 | 10 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 const char* option_keys[] = {"dog", "cat"}; | 395 const char* option_keys[] = {"dog", "cat"}; |
396 const char* option_values[] = {"apple", "banana"}; | 396 const char* option_values[] = {"apple", "banana"}; |
397 | 397 |
398 JSONStream js; | 398 JSONStream js; |
399 EXPECT(js.num_arguments() == 0); | 399 EXPECT(js.num_arguments() == 0); |
400 js.SetArguments(&arguments[0], 3); | 400 js.SetArguments(&arguments[0], 3); |
401 EXPECT(js.num_arguments() == 3); | 401 EXPECT(js.num_arguments() == 3); |
402 EXPECT_STREQ("a", js.command()); | 402 EXPECT_STREQ("a", js.command()); |
403 | 403 |
404 EXPECT(js.num_options() == 0); | 404 EXPECT(js.num_options() == 0); |
405 js.SetOptions(&option_keys[0], &option_values[0], 3); | 405 js.SetOptions(&option_keys[0], &option_values[0], 2); |
406 EXPECT(js.num_options() == 3); | 406 EXPECT(js.num_options() == 2); |
407 EXPECT(!js.HasOption("lizard")); | 407 EXPECT(!js.HasOption("lizard")); |
408 EXPECT(js.HasOption("dog")); | 408 EXPECT(js.HasOption("dog")); |
409 EXPECT(js.HasOption("cat")); | 409 EXPECT(js.HasOption("cat")); |
410 EXPECT(js.OptionIs("cat", "banana")); | 410 EXPECT(js.OptionIs("cat", "banana")); |
411 EXPECT(!js.OptionIs("dog", "banana")); | 411 EXPECT(!js.OptionIs("dog", "banana")); |
412 } | 412 } |
413 | 413 |
414 } // namespace dart | 414 } // namespace dart |
OLD | NEW |