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

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

Powered by Google App Engine
This is Rietveld 408576698