Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: tests/fletch_tests/self_tests.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/fletch_tests/multiprogram_tests.dart ('k') | tests/fletch_tests/sentence_tests.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
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.md file.
4
5 /// Tests of fletch_test_suite.dart.
6 library fletch_tests.self_tests;
7
8 import 'dart:async' show
9 Completer,
10 Future;
11
12 import 'dart:convert' show
13 JSON;
14
15 import 'package:expect/expect.dart' show
16 Expect;
17
18 import 'messages.dart';
19
20 import 'fletch_test_suite.dart' as suite show print;
21
22 /// Test sleeps for 3 seconds.
23 Future testSleepForThreeSeconds() async {
24 await new Future.delayed(const Duration(seconds: 3));
25 }
26
27 /// Always fails.
28 Future testAlwaysFails() async {
29 throw "This test always fails.";
30 }
31
32 /// Never completes (should be skipped).
33 Future testNeverCompletes() => new Completer().future;
34
35 /// Test that messages can be instantiated and printed.
36 Future testMessages() async {
37 void testMessage(Message message) {
38 String json = JSON.encode(message);
39 Expect.stringEquals('$message', '${new Message.fromJson(json)}');
40 }
41
42 testMessage(const InternalErrorMessage("arg1", "arg2"));
43 testMessage(const ListTests());
44 testMessage(const ListTestsReply(const <String>[]));
45 testMessage(const RunTest("arg1"));
46 testMessage(const TimedOut("arg1"));
47 testMessage(const TestFailed("arg1", "arg2", "arg3"));
48 testMessage(const TestPassed("arg1"));
49 testMessage(const Info("message"));
50 testMessage(const TestStdoutLine("name", "line"));
51 }
52
53 /// Test print method.
54 Future testPrint() async {
55 suite.print("Debug print from fletch_tests works.");
56 }
OLDNEW
« no previous file with comments | « tests/fletch_tests/multiprogram_tests.dart ('k') | tests/fletch_tests/sentence_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698