From 23a2aeeaf640e24e123f803a326ea72727fd8993 Mon Sep 17 00:00:00 2001 From: Boris Terzic Date: Sat, 15 Mar 2014 20:30:01 +0100 Subject: [PATCH] Changing references to dart:json to use dart:convert and updating method signatures in the unit tests --- lib/parsers/config_parser_json.dart | 4 ++-- test/tests.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/parsers/config_parser_json.dart b/lib/parsers/config_parser_json.dart index 4b6efc5..34e5b41 100644 --- a/lib/parsers/config_parser_json.dart +++ b/lib/parsers/config_parser_json.dart @@ -1,7 +1,7 @@ library config_parser_json; import 'dart:async'; -import 'dart:json' as JSON; +import 'dart:convert'; import '../config.dart'; @@ -10,7 +10,7 @@ class JsonConfigParser implements ConfigParser { Future parse(String configText) { var completer = new Completer(); - var map = JSON.parse(configText); + var map = JSON.decode(configText); completer.complete(map); return completer.future; diff --git a/test/tests.dart b/test/tests.dart index 094f743..d60cc19 100644 --- a/test/tests.dart +++ b/test/tests.dart @@ -106,7 +106,7 @@ class MapMatcher implements Matcher { // JSON parse the item back into a map, and compare the two maps // (brute force, innefficient) - bool matches(Map item, MatchState matchState) { + bool matches(Map item, Map matchState) { var result = true; // try and compare the item and the map @@ -120,7 +120,7 @@ class MapMatcher implements Matcher { } Description describeMismatch(item, Description mismatchDescription, - MatchState matchState, bool verbose) { + Map matchState, bool verbose) { mismatchDescription.add("item: ${item.toString()}"); return mismatchDescription;