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

Unified Diff: tests/html/svgelement_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tests/html/svgelement_test.dart
===================================================================
--- tests/html/svgelement_test.dart (revision 14156)
+++ tests/html/svgelement_test.dart (working copy)
@@ -10,6 +10,9 @@
main() {
useHtmlConfiguration();
+ var isSVGSVGElement =
+ predicate((x) => x is SVGSVGElement, 'is a SVGSVGElement');
+
Collection<String> _nodeStrings(Collection<Node> input) {
final out = new List<String>();
for (Node n in input) {
@@ -25,9 +28,9 @@
testConstructor(String tagName, Function isExpectedClass) {
test(tagName, () {
- Expect.isTrue(isExpectedClass(new SVGElement.tag(tagName)));
- Expect.isTrue(isExpectedClass(
- new SVGElement.svg('<$tagName></$tagName>')));
+ expect(isExpectedClass(new SVGElement.tag(tagName)), isTrue);
+ expect(isExpectedClass(
+ new SVGElement.svg('<$tagName></$tagName>')), isTrue);
});
}
@@ -40,23 +43,22 @@
<path></path>
</svg>""";
final el = new SVGElement.svg(svg);
- Expect.isTrue(el is SVGSVGElement);
- Expect.equals("<circle></circle><path></path>", el.innerHTML);
- Expect.equals(svg, el.outerHTML);
+ expect(el, isSVGSVGElement);
+ expect(el.innerHTML, "<circle></circle><path></path>");
+ expect(el.outerHTML, svg);
});
test('has no parent', () =>
- Expect.isNull(new SVGElement.svg('<circle/>').parent));
+ expect(new SVGElement.svg('<circle/>').parent, isNull)
+ );
test('empty', () {
- Expect.throws(() => new SVGElement.svg(""),
- (e) => e is ArgumentError);
+ expect(() => new SVGElement.svg(""), throwsArgumentError);
});
test('too many elements', () {
- Expect.throws(
- () => new SVGElement.svg("<circle></circle><path></path>"),
- (e) => e is ArgumentError);
+ expect(() => new SVGElement.svg("<circle></circle><path></path>"),
+ throwsArgumentError);
});
});
@@ -149,8 +151,8 @@
final el = new SVGSVGElement();
el.elements.add(new SVGElement.tag("circle"));
el.elements.add(new SVGElement.tag("path"));
- Expect.equals('<svg version="1.1"><circle></circle><path></path></svg>',
- el.outerHTML);
+ expect(el.outerHTML,
+ '<svg version="1.1"><circle></circle><path></path></svg>');
});
group('innerHTML', () {
@@ -158,7 +160,7 @@
final el = new SVGSVGElement();
el.elements.add(new SVGElement.tag("circle"));
el.elements.add(new SVGElement.tag("path"));
- Expect.equals('<circle></circle><path></path>', el.innerHTML);
+ expect(el.innerHTML, '<circle></circle><path></path>');
});
test('set', () {
@@ -166,7 +168,7 @@
el.elements.add(new SVGElement.tag("circle"));
el.elements.add(new SVGElement.tag("path"));
el.innerHTML = '<rect></rect><a></a>';
- Expect.listEquals(["rect", "a"], _nodeStrings(el.elements));
+ expect(_nodeStrings(el.elements), ["rect", "a"]);
});
});
@@ -178,13 +180,13 @@
<path></path>
text
</svg>""");
- Expect.listEquals(["circle", "path"], _nodeStrings(el.elements));
+ expect(_nodeStrings(el.elements), ["circle", "path"]);
});
test('set', () {
final el = new SVGSVGElement();
el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")];
- Expect.equals('<circle></circle><path></path>', el.innerHTML);
+ expect(el.innerHTML, '<circle></circle><path></path>');
});
});
}

Powered by Google App Engine
This is Rietveld 408576698