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

Side by Side Diff: tests/dartino_compiler/serialize_settings_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
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 /// Tests that [Settings] instances can be serialized and deserialized. 5 /// Tests that [Settings] instances can be serialized and deserialized.
6 library fletch_tests.settings_persist; 6 library dartino_tests.settings_persist;
7 7
8 import 'dart:async' show Future; 8 import 'dart:async' show Future;
9 9
10 import 'dart:convert'; 10 import 'dart:convert';
11 11
12 import 'package:fletchc/src/worker/developer.dart' show 12 import 'package:dartino_compiler/src/worker/developer.dart' show
13 Address, 13 Address,
14 DeviceType, 14 DeviceType,
15 IncrementalMode, 15 IncrementalMode,
16 Settings, 16 Settings,
17 parseSettings; 17 parseSettings;
18 18
19 import 'package:fletchc/src/verbs/infrastructure.dart' show 19 import 'package:dartino_compiler/src/verbs/infrastructure.dart' show
20 fileUri; 20 fileUri;
21 21
22 import 'package:expect/expect.dart'; 22 import 'package:expect/expect.dart';
23 23
24 void testSettingsRoundTrip(Settings settings) { 24 void testSettingsRoundTrip(Settings settings) {
25 Settings before = settings; 25 Settings before = settings;
26 Map<String, dynamic> json = before.toJson(); 26 Map<String, dynamic> json = before.toJson();
27 Settings after = parseSettings(const JsonCodec().encode(json), 27 Settings after = parseSettings(const JsonCodec().encode(json),
28 Uri.parse("file:///dummy.fletch-settings")); 28 Uri.parse("file:///dummy.dartino-settings"));
29 Expect.equals(before.packages, after.packages); 29 Expect.equals(before.packages, after.packages);
30 Expect.listEquals(before.options, after.options); 30 Expect.listEquals(before.options, after.options);
31 Expect.mapEquals(before.constants, after.constants); 31 Expect.mapEquals(before.constants, after.constants);
32 Expect.equals(before.deviceAddress, after.deviceAddress); 32 Expect.equals(before.deviceAddress, after.deviceAddress);
33 Expect.equals(before.deviceType, after.deviceType); 33 Expect.equals(before.deviceType, after.deviceType);
34 Expect.equals(before.incrementalMode, after.incrementalMode); 34 Expect.equals(before.incrementalMode, after.incrementalMode);
35 } 35 }
36 36
37 Future<Null> main() async { 37 Future<Null> main() async {
38 testSettingsRoundTrip(new Settings.empty()); 38 testSettingsRoundTrip(new Settings.empty());
39 testSettingsRoundTrip(new Settings( 39 testSettingsRoundTrip(new Settings(
40 fileUri(".packages", Uri.base), 40 fileUri(".packages", Uri.base),
41 ["a", "b", "c"], 41 ["a", "b", "c"],
42 {"a": "A", "b": "b"}, 42 {"a": "A", "b": "b"},
43 new Address("localhost", 8080), 43 new Address("localhost", 8080),
44 DeviceType.embedded, 44 DeviceType.embedded,
45 IncrementalMode.experimental)); 45 IncrementalMode.experimental));
46 } 46 }
OLDNEW
« no previous file with comments | « tests/dartino_compiler/run.dart ('k') | tests/dartino_compiler/test_incremental_debug_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698