#1243 Runtime type checks added
diff --git a/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t03.dart b/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t03.dart
index 413d6a0..716ffce 100644
--- a/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t03.dart
+++ b/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t03.dart
@@ -16,5 +16,6 @@
main() {
Expect.isTrue(C<Never>() is C<Never>);
+ Expect.runtimeIsType<C<Never>>(C<Never>());
void x2 = foo<Never>();
}
diff --git a/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t04.dart b/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t04.dart
index bd11243..2e29531 100644
--- a/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t04.dart
+++ b/LanguageFeatures/Subtyping/static/tests/left_bottom_A01_t04.dart
@@ -18,5 +18,6 @@
main() {
Expect.isTrue(C<Neverland>() is C<Never>);
+ Expect.runtimeIsType<C<Never>>(C<Neverland>());
void x2 = foo<Neverland>();
}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart
index 998000f..a7b75eb 100644
--- a/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart
+++ b/LanguageFeatures/Super-parameters/type_inference_A01_t01.dart
@@ -33,6 +33,14 @@
Expect.isFalse(i is String);
Expect.isTrue(t is int);
Expect.isFalse(t is String);
+ Expect.runtimeIsType<int>(f);
+ Expect.runtimeIsNotType<String>(f);
+ Expect.runtimeIsType<int>(v);
+ Expect.runtimeIsNotType<String>(v);
+ Expect.runtimeIsType<int>(i);
+ Expect.runtimeIsNotType<String>(i);
+ Expect.runtimeIsType<int>(t);
+ Expect.runtimeIsNotType<String>(t);
}
}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart
index 0a2fc1e..5379148 100644
--- a/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart
+++ b/LanguageFeatures/Super-parameters/type_inference_A02_t01.dart
@@ -40,6 +40,14 @@
Expect.isFalse(i is String);
Expect.isTrue(t is int);
Expect.isFalse(t is String);
+ Expect.runtimeIsType<int>(f);
+ Expect.runtimeIsNotType<String>(f);
+ Expect.runtimeIsType<int>(v);
+ Expect.runtimeIsNotType<String>(v);
+ Expect.runtimeIsType<int>(i);
+ Expect.runtimeIsNotType<String>(i);
+ Expect.runtimeIsType<int>(t);
+ Expect.runtimeIsNotType<String>(t);
}
}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart b/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart
index 3ea3e8b..374ace6 100644
--- a/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart
+++ b/LanguageFeatures/Super-parameters/type_inference_A03_t01.dart
@@ -66,6 +66,22 @@
Expect.isFalse(c1.i2 is String);
Expect.isTrue(c1.t2 is int);
Expect.isFalse(c1.t2 is String);
+ Expect.runtimeIsType<int>(c1.f1);
+ Expect.runtimeIsNotType<String>(c1.f1);
+ Expect.runtimeIsType<int>(c1.v1);
+ Expect.runtimeIsNotType<String>(c1.v1);
+ Expect.runtimeIsType<int>(c1.i1);
+ Expect.runtimeIsNotType<String>(c1.i1);
+ Expect.runtimeIsType<int>(c1.t1);
+ Expect.runtimeIsNotType<String>(c1.t1);
+ Expect.runtimeIsType<int>(c1.f2);
+ Expect.runtimeIsNotType<String>(c1.f2);
+ Expect.runtimeIsType<int>(c1.v2);
+ Expect.runtimeIsNotType<String>(c1.v2);
+ Expect.runtimeIsType<int>(c1.i2);
+ Expect.runtimeIsNotType<String>(c1.i2);
+ Expect.runtimeIsType<int>(c1.t2);
+ Expect.runtimeIsNotType<String>(c1.t2);
C<int> c2 = C<int>(1, 2, 3, 4, 5, 6, 7, 8, 9);
test<int>(c2.f1);
@@ -93,4 +109,20 @@
Expect.isFalse(c2.i2 is String);
Expect.isTrue(c2.t2 is int);
Expect.isFalse(c2.t2 is String);
+ Expect.runtimeIsType<int>(c2.f1);
+ Expect.runtimeIsNotType<String>(c2.f1);
+ Expect.runtimeIsType<int>(c2.v1);
+ Expect.runtimeIsNotType<String>(c2.v1);
+ Expect.runtimeIsType<int>(c2.i1);
+ Expect.runtimeIsNotType<String>(c2.i1);
+ Expect.runtimeIsType<int>(c2.t1);
+ Expect.runtimeIsNotType<String>(c2.t1);
+ Expect.runtimeIsType<int>(c2.f2);
+ Expect.runtimeIsNotType<String>(c2.f2);
+ Expect.runtimeIsType<int>(c2.v2);
+ Expect.runtimeIsNotType<String>(c2.v2);
+ Expect.runtimeIsType<int>(c2.i2);
+ Expect.runtimeIsNotType<String>(c2.i2);
+ Expect.runtimeIsType<int>(c2.t2);
+ Expect.runtimeIsNotType<String>(c2.t2);
}
diff --git a/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart b/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart
index 1efe958..324fa19 100644
--- a/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart
+++ b/LanguageFeatures/Super-parameters/type_inference_A03_t02.dart
@@ -63,6 +63,22 @@
Expect.isFalse(c1.i2 is String);
Expect.isTrue(c1.t2 is int);
Expect.isFalse(c1.t2 is String);
+ Expect.runtimeIsType<int>(c1.f1);
+ Expect.runtimeIsNotType<String>(c1.f1);
+ Expect.runtimeIsType<int>(c1.v1);
+ Expect.runtimeIsNotType<String>(c1.v1);
+ Expect.runtimeIsType<int>(c1.i1);
+ Expect.runtimeIsNotType<String>(c1.i1);
+ Expect.runtimeIsType<int>(c1.t1);
+ Expect.runtimeIsNotType<String>(c1.t1);
+ Expect.runtimeIsType<int>(c1.f2);
+ Expect.runtimeIsNotType<String>(c1.f2);
+ Expect.runtimeIsType<int>(c1.v2);
+ Expect.runtimeIsNotType<String>(c1.v2);
+ Expect.runtimeIsType<int>(c1.i2);
+ Expect.runtimeIsNotType<String>(c1.i2);
+ Expect.runtimeIsType<int>(c1.t2);
+ Expect.runtimeIsNotType<String>(c1.t2);
C<int> c2 = C(1, 2, 3, 4, 5, 6, 7, 8);
test<int>(c2.f1);
@@ -90,4 +106,20 @@
Expect.isFalse(c2.i2 is String);
Expect.isTrue(c2.t2 is int);
Expect.isFalse(c2.t2 is String);
+ Expect.runtimeIsType<int>(c2.f1);
+ Expect.runtimeIsNotType<String>(c2.f1);
+ Expect.runtimeIsType<int>(c2.v1);
+ Expect.runtimeIsNotType<String>(c2.v1);
+ Expect.runtimeIsType<int>(c2.i1);
+ Expect.runtimeIsNotType<String>(c2.i1);
+ Expect.runtimeIsType<int>(c2.t1);
+ Expect.runtimeIsNotType<String>(c2.t1);
+ Expect.runtimeIsType<int>(c2.f2);
+ Expect.runtimeIsNotType<String>(c2.f2);
+ Expect.runtimeIsType<int>(c2.v2);
+ Expect.runtimeIsNotType<String>(c2.v2);
+ Expect.runtimeIsType<int>(c2.i2);
+ Expect.runtimeIsNotType<String>(c2.i2);
+ Expect.runtimeIsType<int>(c2.t2);
+ Expect.runtimeIsNotType<String>(c2.t2);
}
diff --git a/LibTest/async/Completer/Completer_A01_t01.dart b/LibTest/async/Completer/Completer_A01_t01.dart
index f7152c6..91b2c4a 100644
--- a/LibTest/async/Completer/Completer_A01_t01.dart
+++ b/LibTest/async/Completer/Completer_A01_t01.dart
@@ -11,6 +11,7 @@
import "dart:async";
main() {
- Completer completer = new Completer();
+ var completer = new Completer();
Expect.isTrue(completer is Completer);
+ Expect.runtimeIsType<Completer>(completer);
}
diff --git a/LibTest/async/Completer/future_A01_t01.dart b/LibTest/async/Completer/future_A01_t01.dart
index ef33071..bf18bbf 100644
--- a/LibTest/async/Completer/future_A01_t01.dart
+++ b/LibTest/async/Completer/future_A01_t01.dart
@@ -13,4 +13,5 @@
main() {
Completer completer = new Completer();
Expect.isTrue(completer.future is Future);
+ Expect.runtimeIsType<Future>(completer.future);
}
diff --git a/LibTest/async/EventSink/EventSink_A01_t01.test.dart b/LibTest/async/EventSink/EventSink_A01_t01.test.dart
index cfaad52..8957dd8 100644
--- a/LibTest/async/EventSink/EventSink_A01_t01.test.dart
+++ b/LibTest/async/EventSink/EventSink_A01_t01.test.dart
@@ -12,8 +12,8 @@
import "../../../Utils/expect.dart";
test(EventSink create()) {
- EventSink es = create();
-
+ var es = create();
Expect.isTrue(es is EventSink);
+ Expect.runtimeIsType<EventSink>(es);
}
diff --git a/LibTest/async/EventSink/runtimeType_A01_t01.test.dart b/LibTest/async/EventSink/runtimeType_A01_t01.test.dart
index 0816100..4276fc9 100644
--- a/LibTest/async/EventSink/runtimeType_A01_t01.test.dart
+++ b/LibTest/async/EventSink/runtimeType_A01_t01.test.dart
@@ -19,6 +19,8 @@
Expect.isTrue(es1.runtimeType is Type);
Expect.isTrue(es2.runtimeType is Type);
+ Expect.runtimeIsType<Type>(es1.runtimeType);
+ Expect.runtimeIsType<Type>(es2.runtimeType);
Expect.equals(es1.runtimeType, es2.runtimeType);
Expect.notEquals(es1.runtimeType, o.runtimeType);
}
diff --git a/LibTest/async/EventSink/toString_A01_t01.test.dart b/LibTest/async/EventSink/toString_A01_t01.test.dart
index 897dc01..019f648 100644
--- a/LibTest/async/EventSink/toString_A01_t01.test.dart
+++ b/LibTest/async/EventSink/toString_A01_t01.test.dart
@@ -19,6 +19,8 @@
Expect.isTrue(es1.toString() is String);
Expect.isTrue(es2.toString() is String);
+ Expect.runtimeIsType<String>(es1.toString());
+ Expect.runtimeIsType<String>(es2.toString());
Expect.notEquals(es1, es2);
Expect.equals(es1.toString(), es2.toString());
}
diff --git a/LibTest/async/StreamConsumer/StreamConsumer_A01_t01.test.dart b/LibTest/async/StreamConsumer/StreamConsumer_A01_t01.test.dart
index c7ab387..02fb41c 100644
--- a/LibTest/async/StreamConsumer/StreamConsumer_A01_t01.test.dart
+++ b/LibTest/async/StreamConsumer/StreamConsumer_A01_t01.test.dart
@@ -12,8 +12,8 @@
import "../../../Utils/expect.dart";
test(StreamConsumer create()) {
- StreamConsumer sc = create();
-
+ var sc = create();
Expect.isTrue(sc is StreamConsumer);
+ Expect.runtimeIsType<StreamConsumer>(sc);
}
diff --git a/LibTest/async/StreamConsumer/runtimeType_A01_t01.test.dart b/LibTest/async/StreamConsumer/runtimeType_A01_t01.test.dart
index c5a9825..3dd1f8d 100644
--- a/LibTest/async/StreamConsumer/runtimeType_A01_t01.test.dart
+++ b/LibTest/async/StreamConsumer/runtimeType_A01_t01.test.dart
@@ -19,6 +19,8 @@
Expect.isTrue(sc1.runtimeType is Type);
Expect.isTrue(sc2.runtimeType is Type);
+ Expect.runtimeIsType<Type>(sc1.runtimeType);
+ Expect.runtimeIsType<Type>(sc2.runtimeType);
Expect.equals(sc1.runtimeType, sc2.runtimeType);
Expect.notEquals(sc1.runtimeType, o.runtimeType);
}
diff --git a/LibTest/async/StreamConsumer/toString_A01_t01.test.dart b/LibTest/async/StreamConsumer/toString_A01_t01.test.dart
index a137b3b..cd445de 100644
--- a/LibTest/async/StreamConsumer/toString_A01_t01.test.dart
+++ b/LibTest/async/StreamConsumer/toString_A01_t01.test.dart
@@ -19,6 +19,8 @@
Expect.isTrue(sc1.toString() is String);
Expect.isTrue(sc2.toString() is String);
+ Expect.runtimeIsType<String>(sc1.toString());
+ Expect.runtimeIsType<String>(sc2.toString());
Expect.notEquals(sc1, sc2);
Expect.equals(sc1.toString(), sc2.toString());
}
diff --git a/LibTest/async/StreamController/close_A01_t01.dart b/LibTest/async/StreamController/close_A01_t01.dart
index d0955b3..1d99580 100644
--- a/LibTest/async/StreamController/close_A01_t01.dart
+++ b/LibTest/async/StreamController/close_A01_t01.dart
@@ -15,4 +15,5 @@
main() {
Expect.isTrue(new StreamController().close() is Future);
+ Expect.runtimeIsType<Future>(new StreamController().close());
}
diff --git a/LibTest/async/StreamController/done_A01_t01.dart b/LibTest/async/StreamController/done_A01_t01.dart
index 4cd3de0..c8ac77d 100644
--- a/LibTest/async/StreamController/done_A01_t01.dart
+++ b/LibTest/async/StreamController/done_A01_t01.dart
@@ -16,10 +16,10 @@
/// @description Checks that returned value is a Future.
/// @author ilya
-
import "dart:async";
import "../../../Utils/expect.dart";
main() {
Expect.isTrue(new StreamController().done is Future);
+ Expect.runtimeIsType<Future>(new StreamController().done);
}
diff --git a/LibTest/async/StreamController/stream_A01_t01.dart b/LibTest/async/StreamController/stream_A01_t01.dart
index a7a8574..46d34f2 100644
--- a/LibTest/async/StreamController/stream_A01_t01.dart
+++ b/LibTest/async/StreamController/stream_A01_t01.dart
@@ -12,6 +12,7 @@
main() {
StreamController controller = new StreamController();
- Stream stream = controller.stream;
+ var stream = controller.stream;
Expect.isTrue(stream is Stream);
+ Expect.runtimeIsType<Stream>(stream);
}
diff --git a/LibTest/async/StreamIterator/StreamIterator_A01_t01.dart b/LibTest/async/StreamIterator/StreamIterator_A01_t01.dart
index f7f008b..8fc739f 100644
--- a/LibTest/async/StreamIterator/StreamIterator_A01_t01.dart
+++ b/LibTest/async/StreamIterator/StreamIterator_A01_t01.dart
@@ -11,7 +11,8 @@
import "../../../Utils/expect.dart";
main() {
- StreamController controller = new StreamController();
- StreamIterator streamIterator = new StreamIterator(controller.stream);
+ var controller = new StreamController();
+ var streamIterator = new StreamIterator(controller.stream);
Expect.isTrue(streamIterator is StreamIterator);
+ Expect.runtimeIsType<StreamIterator>(streamIterator);
}
diff --git a/LibTest/async/Zone/registerBinaryCallback_A01_t01.dart b/LibTest/async/Zone/registerBinaryCallback_A01_t01.dart
index 6fc5f53..894a588 100644
--- a/LibTest/async/Zone/registerBinaryCallback_A01_t01.dart
+++ b/LibTest/async/Zone/registerBinaryCallback_A01_t01.dart
@@ -28,6 +28,7 @@
z.registerBinaryCallback<int, int, int>(f);
Expect.isTrue(callback is ZoneBinaryCallback<int, int, int>);
+ Expect.runtimeIsType<ZoneBinaryCallback<int, int, int>>(callback);
Expect.equals(3, callback(1, 2));
ZoneBinaryCallback<R, T1, T2> registerFunction<R, T1, T2>(
@@ -41,6 +42,7 @@
ZoneBinaryCallback<int, int, int> callback =
Zone.current.registerBinaryCallback<int, int, int>(f);
Expect.isTrue(callback is ZoneBinaryCallback<int, int, int>);
+ Expect.runtimeIsType<ZoneBinaryCallback<int, int, int>>(callback);
Expect.equals(42, callback(1, 2));
});
}
diff --git a/LibTest/async/Zone/registerCallback_A01_t01.dart b/LibTest/async/Zone/registerCallback_A01_t01.dart
index b731d47..b71160a 100644
--- a/LibTest/async/Zone/registerCallback_A01_t01.dart
+++ b/LibTest/async/Zone/registerCallback_A01_t01.dart
@@ -25,6 +25,7 @@
ZoneCallback<int> callback = z.registerCallback<int>(f);
Expect.isTrue(callback is ZoneCallback<int>);
+ Expect.runtimeIsType<ZoneCallback<int>>(callback);
Expect.equals(0, callback());
ZoneCallback<R> registerFunction<R>(Zone self, ZoneDelegate parent, Zone zone, R f()) {
@@ -35,6 +36,7 @@
.run(() {
ZoneCallback<int> callback = Zone.current.registerCallback<int>(f);
Expect.isTrue(callback is ZoneCallback<int>);
+ Expect.runtimeIsType<ZoneCallback<int>>(callback);
Expect.equals(42, callback());
});
}
diff --git a/LibTest/async/Zone/registerUnaryCallback_A01_t01.dart b/LibTest/async/Zone/registerUnaryCallback_A01_t01.dart
index 189f148..cc25091 100644
--- a/LibTest/async/Zone/registerUnaryCallback_A01_t01.dart
+++ b/LibTest/async/Zone/registerUnaryCallback_A01_t01.dart
@@ -26,7 +26,8 @@
ZoneUnaryCallback<int,int> callback = z.registerUnaryCallback<int,int>(f);
- Expect.isTrue(callback is ZoneUnaryCallback<int,int>);
+ Expect.isTrue(callback is ZoneUnaryCallback<int, int>);
+ Expect.runtimeIsType<ZoneUnaryCallback<int, int>>(callback);
Expect.equals(1, callback(1));
ZoneUnaryCallback<R, T> registerFunction<R, T>(
@@ -37,7 +38,8 @@
z.fork(specification: new ZoneSpecification(registerUnaryCallback:registerFunction))
.run(() {
ZoneUnaryCallback<int,int> callback = Zone.current.registerUnaryCallback<int,int>(f);
- Expect.isTrue(callback is ZoneUnaryCallback<int,int>);
+ Expect.isTrue(callback is ZoneUnaryCallback<int, int>);
+ Expect.runtimeIsType<ZoneUnaryCallback<int, int>>(callback);
Expect.equals(42, callback(1));
});
}
diff --git a/LibTest/async/Zone/root_A01_t01.dart b/LibTest/async/Zone/root_A01_t01.dart
index 195e2d1..5e1454e 100644
--- a/LibTest/async/Zone/root_A01_t01.dart
+++ b/LibTest/async/Zone/root_A01_t01.dart
@@ -12,4 +12,5 @@
main() {
Expect.isTrue(Zone.root is Zone);
+ Expect.runtimeIsType<Zone>(Zone.root);
}
diff --git a/LibTest/collection/DoubleLinkedQueue/iterator_A01_t01.dart b/LibTest/collection/DoubleLinkedQueue/iterator_A01_t01.dart
index ca07b6d..547c9ee 100644
--- a/LibTest/collection/DoubleLinkedQueue/iterator_A01_t01.dart
+++ b/LibTest/collection/DoubleLinkedQueue/iterator_A01_t01.dart
@@ -17,21 +17,29 @@
main() {
Queue list = new DoubleLinkedQueue();
Expect.isTrue(list.iterator is Iterator);
+ Expect.runtimeIsType<Iterator>(list.iterator);
list = new DoubleLinkedQueue.from([null]);
Expect.isTrue(list.iterator is Iterator);
+ Expect.runtimeIsType<Iterator>(list.iterator);
list = new DoubleLinkedQueue.from([[]]);
Expect.isTrue(list.iterator is Iterator);
+ Expect.runtimeIsType<Iterator>(list.iterator);
list = new DoubleLinkedQueue<int>();
Expect.isTrue(list.iterator is Iterator<int>);
Expect.isFalse(list.iterator is Iterator<bool>);
Expect.isFalse(list.iterator is Iterator<String>);
+ Expect.runtimeIsType<Iterator<int>>(list.iterator);
+ Expect.runtimeIsNotType<Iterator<bool>>(list.iterator);
+ Expect.runtimeIsNotType<Iterator<String>>(list.iterator);
list = new DoubleLinkedQueue<bool>();
Expect.isTrue(list.iterator is Iterator<bool>);
+ Expect.runtimeIsType<Iterator<bool>>(list.iterator);
list = new DoubleLinkedQueue<A>();
Expect.isTrue(list.iterator is Iterator<A>);
+ Expect.runtimeIsType<Iterator<A>>(list.iterator);
}
diff --git a/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t01.dart b/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t01.dart
index afb76b0..3c21d26 100644
--- a/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t01.dart
+++ b/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t01.dart
@@ -13,7 +13,8 @@
main() {
double d = 3.14;
- DoubleLinkedQueueEntry entry = new DoubleLinkedQueueEntry(d);
+ var entry = new DoubleLinkedQueueEntry(d);
Expect.isTrue(entry is DoubleLinkedQueueEntry);
+ Expect.runtimeIsType<DoubleLinkedQueueEntry>(entry);
Expect.equals(d, entry.element);
}
diff --git a/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t02.dart b/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t02.dart
index 5da756a..871fb65 100644
--- a/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t02.dart
+++ b/LibTest/collection/DoubleLinkedQueueEntry/DoubleLinkedQueueEntry_A01_t02.dart
@@ -14,5 +14,6 @@
main() {
DoubleLinkedQueueEntry entry = new DoubleLinkedQueueEntry(null);
Expect.isTrue(entry is DoubleLinkedQueueEntry);
+ Expect.runtimeIsType<DoubleLinkedQueueEntry>(entry);
Expect.isNull(entry.element);
}
diff --git a/LibTest/collection/HasNextIterator/HasNextIterator_A01_t01.dart b/LibTest/collection/HasNextIterator/HasNextIterator_A01_t01.dart
index eb06758..01d7f15 100644
--- a/LibTest/collection/HasNextIterator/HasNextIterator_A01_t01.dart
+++ b/LibTest/collection/HasNextIterator/HasNextIterator_A01_t01.dart
@@ -11,9 +11,11 @@
main() {
List list = [1, 2, 3, 4, 5];
- HasNextIterator hnit = new HasNextIterator(list.iterator);
+ var hnit = new HasNextIterator(list.iterator);
Expect.isTrue(hnit is HasNextIterator);
+ Expect.runtimeIsType<HasNextIterator>(hnit);
hnit = new HasNextIterator([].iterator);
Expect.isTrue(hnit is HasNextIterator);
+ Expect.runtimeIsType<HasNextIterator>(hnit);
}
diff --git a/LibTest/collection/HashMap/HashMap_A01_t01.dart b/LibTest/collection/HashMap/HashMap_A01_t01.dart
index 6582666..03bccbb 100644
--- a/LibTest/collection/HashMap/HashMap_A01_t01.dart
+++ b/LibTest/collection/HashMap/HashMap_A01_t01.dart
@@ -12,7 +12,8 @@
import "dart:collection";
main() {
- HashMap map = new HashMap();
+ var map = new HashMap();
Expect.isTrue(map is HashMap);
+ Expect.runtimeIsType<HashMap>(map);
Expect.isTrue(map.isEmpty);
}
diff --git a/LibTest/collection/HashSet/HashSet_A01_t01.dart b/LibTest/collection/HashSet/HashSet_A01_t01.dart
index 7672198..da95549 100644
--- a/LibTest/collection/HashSet/HashSet_A01_t01.dart
+++ b/LibTest/collection/HashSet/HashSet_A01_t01.dart
@@ -14,7 +14,8 @@
import "dart:collection";
main() {
- HashSet s = new HashSet();
+ var s = new HashSet();
Expect.isTrue(s is HashSet);
+ Expect.runtimeIsType<HashSet>(s);
Expect.isTrue(s.isEmpty);
}
diff --git a/LibTest/collection/LinkedHashMap/LinkedHashMap_A01_t01.dart b/LibTest/collection/LinkedHashMap/LinkedHashMap_A01_t01.dart
index 4667fb3..8e54b48 100644
--- a/LibTest/collection/LinkedHashMap/LinkedHashMap_A01_t01.dart
+++ b/LibTest/collection/LinkedHashMap/LinkedHashMap_A01_t01.dart
@@ -10,7 +10,8 @@
import "dart:collection";
main() {
- LinkedHashMap m = new LinkedHashMap();
+ var m = new LinkedHashMap();
Expect.isTrue(m is LinkedHashMap);
+ Expect.runtimeIsType<LinkedHashMap>(m);
Expect.isTrue(m.isEmpty);
}
diff --git a/LibTest/collection/LinkedHashSet/LinkedHashSet_A01_t01.dart b/LibTest/collection/LinkedHashSet/LinkedHashSet_A01_t01.dart
index 15a3281..9f9312e 100644
--- a/LibTest/collection/LinkedHashSet/LinkedHashSet_A01_t01.dart
+++ b/LibTest/collection/LinkedHashSet/LinkedHashSet_A01_t01.dart
@@ -11,7 +11,8 @@
import "dart:collection";
main() {
- LinkedHashSet set = new LinkedHashSet();
+ var set = new LinkedHashSet();
Expect.isTrue(set is LinkedHashSet);
+ Expect.runtimeIsType<LinkedHashSet>(set);
Expect.isTrue(set.isEmpty);
}
diff --git a/LibTest/core/AbstractClassInstantiationError/toString_A01_t01.dart b/LibTest/core/AbstractClassInstantiationError/toString_A01_t01.dart
index d6ede28..cda72d2 100644
--- a/LibTest/core/AbstractClassInstantiationError/toString_A01_t01.dart
+++ b/LibTest/core/AbstractClassInstantiationError/toString_A01_t01.dart
@@ -8,11 +8,9 @@
/// null and is indeed a String.
/// @author rodionov
-
import "../../../Utils/expect.dart";
main() {
AbstractClassInstantiationError e = AbstractClassInstantiationError("testme");
Expect.isNotNull(e.toString());
- Expect.isTrue(e.toString() is String);
}
diff --git a/LibTest/core/AssertionError/AssertionError_A01_t01.dart b/LibTest/core/AssertionError/AssertionError_A01_t01.dart
index 3b9f960..90d6f00 100644
--- a/LibTest/core/AssertionError/AssertionError_A01_t01.dart
+++ b/LibTest/core/AssertionError/AssertionError_A01_t01.dart
@@ -19,6 +19,7 @@
Expect.fail("AssertionError expected");
} on AssertionError catch (e) {
Expect.isTrue(e is Error);
+ Expect.runtimeIsType<Error>(e);
}
}
}
diff --git a/LibTest/core/AssertionError/toString_A01_t01.dart b/LibTest/core/AssertionError/toString_A01_t01.dart
index a6f0b68..7a1233e 100644
--- a/LibTest/core/AssertionError/toString_A01_t01.dart
+++ b/LibTest/core/AssertionError/toString_A01_t01.dart
@@ -16,8 +16,9 @@
assert(1 == 2);
Expect.fail("AssertionError expected");
} on AssertionError catch (e) {
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
}
}
diff --git a/LibTest/core/CastError/CastError_A01_t01.dart b/LibTest/core/CastError/CastError_A01_t01.dart
index 0e21c4d..66e9aae 100644
--- a/LibTest/core/CastError/CastError_A01_t01.dart
+++ b/LibTest/core/CastError/CastError_A01_t01.dart
@@ -12,4 +12,5 @@
main() {
var error = new CastError();
Expect.isTrue(error is CastError);
+ Expect.runtimeIsType<CastError>(error);
}
diff --git a/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t01.dart b/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t01.dart
index 71c36c7..cde2f78 100644
--- a/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t01.dart
+++ b/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t01.dart
@@ -12,4 +12,5 @@
main() {
var error = new ConcurrentModificationError();
Expect.isTrue(error is ConcurrentModificationError);
+ Expect.runtimeIsType<ConcurrentModificationError>(error);
}
diff --git a/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t02.dart b/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t02.dart
index c89bd6a..9d36733 100644
--- a/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t02.dart
+++ b/LibTest/core/ConcurrentModificationError/ConcurrentModificationError_A01_t02.dart
@@ -13,5 +13,6 @@
var ob = "object";
var error = new ConcurrentModificationError(ob);
Expect.isTrue(error is ConcurrentModificationError);
+ Expect.runtimeIsType<ConcurrentModificationError>(error);
Expect.equals(ob, error.modifiedObject);
}
diff --git a/LibTest/core/ConcurrentModificationError/modifiedObject_A01_t02.dart b/LibTest/core/ConcurrentModificationError/modifiedObject_A01_t02.dart
index b574434..ec8a7a4 100644
--- a/LibTest/core/ConcurrentModificationError/modifiedObject_A01_t02.dart
+++ b/LibTest/core/ConcurrentModificationError/modifiedObject_A01_t02.dart
@@ -15,5 +15,6 @@
var ob = "object";
var error = new ConcurrentModificationError(ob);
Expect.isTrue(error is ConcurrentModificationError);
+ Expect.runtimeIsType<ConcurrentModificationError>(error);
Expect.equals(ob, error.modifiedObject);
}
diff --git a/LibTest/core/DateTime/DateTime.now_A01_t01.dart b/LibTest/core/DateTime/DateTime.now_A01_t01.dart
index ba7fa10..45b5518 100644
--- a/LibTest/core/DateTime/DateTime.now_A01_t01.dart
+++ b/LibTest/core/DateTime/DateTime.now_A01_t01.dart
@@ -11,4 +11,5 @@
main(){
Expect.isTrue(new DateTime.now() is DateTime);
+ Expect.runtimeIsType<DateTime>(new DateTime.now());
}
diff --git a/LibTest/core/DateTime/DateTime_A01_t01.dart b/LibTest/core/DateTime/DateTime_A01_t01.dart
index f9bd7b3..9c66948 100644
--- a/LibTest/core/DateTime/DateTime_A01_t01.dart
+++ b/LibTest/core/DateTime/DateTime_A01_t01.dart
@@ -5,7 +5,7 @@
/// @assertion factory DateTime(int year, [int month = 1, int day = 1, int
/// hour = 0, int minute = 0, int second = 0, int millisecond = 0])
/// Constructs a DateTime instance based on the individual parts.
-/// The date is in the local time zone. month and day are one-based.
+/// The date is in the local time zone. month and day are one-based.
/// @description Checks the DateTime constructor with various correct parameters
/// that are within range and do not result in overflow/underflow of any single
/// field.
@@ -13,9 +13,12 @@
import "../../../Utils/expect.dart";
-check(int year, int month, int day, int hours, int minutes, int seconds, int milliseconds) {
- DateTime date = new DateTime(year, month, day, hours, minutes, seconds, milliseconds);
- String msg = 'actual date is ${date.year}-${date.month}-${date.day} ${date.hour}:${date.minute}:${date.second}:${date.millisecond}';
+check(int year, int month, int day, int hours, int minutes, int seconds,
+ int milliseconds) {
+ var date =
+ new DateTime(year, month, day, hours, minutes, seconds, milliseconds);
+ String msg =
+ 'actual date is ${date.year}-${date.month}-${date.day} ${date.hour}:${date.minute}:${date.second}:${date.millisecond}';
Expect.equals(year, date.year, msg);
Expect.equals(month, date.month, msg);
Expect.equals(day, date.day, msg);
@@ -24,6 +27,7 @@
Expect.equals(seconds, date.second, msg);
Expect.equals(milliseconds, date.millisecond, msg);
Expect.isTrue(date is DateTime);
+ Expect.runtimeIsType<DateTime>(date);
}
main() {
diff --git a/LibTest/core/DateTime/add_A01_t01.dart b/LibTest/core/DateTime/add_A01_t01.dart
index 07e3aa2..1ed8a0f 100644
--- a/LibTest/core/DateTime/add_A01_t01.dart
+++ b/LibTest/core/DateTime/add_A01_t01.dart
@@ -10,12 +10,40 @@
import "../../../Utils/expect.dart";
main() {
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
- new Duration(days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
- new Duration(days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
- new Duration(days: -100000, hours: -100000, minutes: -100000, seconds: -100000, milliseconds: -100000)) is DateTime);
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
- new Duration(days: 100000, hours: 100000, minutes: 100000, seconds: 100000, milliseconds: 100000)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(new Duration(
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(new Duration(
+ days: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(new Duration(
+ days: -100000,
+ hours: -100000,
+ minutes: -100000,
+ seconds: -100000,
+ milliseconds: -100000)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(new Duration(
+ days: 100000,
+ hours: 100000,
+ minutes: 100000,
+ seconds: 100000,
+ milliseconds: 100000)) is DateTime);
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
+ new Duration(
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)));
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
+ new Duration(
+ days: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)));
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
+ new Duration(
+ days: -100000,
+ hours: -100000,
+ minutes: -100000,
+ seconds: -100000,
+ milliseconds: -100000)));
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).add(
+ new Duration(
+ days: 100000,
+ hours: 100000,
+ minutes: 100000,
+ seconds: 100000,
+ milliseconds: 100000)));
}
diff --git a/LibTest/core/DateTime/day_A01_t01.dart b/LibTest/core/DateTime/day_A01_t01.dart
index 6acd671..c0ffc4b 100644
--- a/LibTest/core/DateTime/day_A01_t01.dart
+++ b/LibTest/core/DateTime/day_A01_t01.dart
@@ -20,5 +20,6 @@
void check(int d) {
DateTime date = new DateTime(2011, 8, d, 0, 0, 0, 0);
Expect.isTrue(date.day is int);
+ Expect.runtimeIsType<int>(date.day);
Expect.equals(d, date.day);
}
diff --git a/LibTest/core/DateTime/difference_A01_t01.dart b/LibTest/core/DateTime/difference_A01_t01.dart
index c5d2c65..d4c029f 100644
--- a/LibTest/core/DateTime/difference_A01_t01.dart
+++ b/LibTest/core/DateTime/difference_A01_t01.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// @assertion Duration difference(DateTime other)
+/// @assertion Duration difference(DateTime other)
/// Returns a [Duration] with the difference of [:this:] and [other]
/// @description Checks that the method returns Duration instance
/// @author hlodvig
@@ -11,9 +11,26 @@
main() {
Expect.isTrue(new DateTime.now().difference(new DateTime.now()) is Duration);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0).difference(new DateTime.fromMillisecondsSinceEpoch(1000)) is Duration);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0).difference(new DateTime.fromMillisecondsSinceEpoch(-1000)) is Duration);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(1000).difference(new DateTime.fromMillisecondsSinceEpoch(0)) is Duration);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(1000).difference(new DateTime.fromMillisecondsSinceEpoch(0)) is Duration);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0).difference(new DateTime.fromMillisecondsSinceEpoch(1000)) is Duration);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(1000)) is Duration);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(-1000)) is Duration);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(1000)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(0)) is Duration);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(1000)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(0)) is Duration);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(1000)) is Duration);
+ Expect.runtimeIsType<Duration>(
+ new DateTime.now().difference(new DateTime.now()));
+ Expect.runtimeIsType<Duration>(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(1000)));
+ Expect.runtimeIsType<Duration>(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(-1000)));
+ Expect.runtimeIsType<Duration>(new DateTime.fromMillisecondsSinceEpoch(1000)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(0)));
+ Expect.runtimeIsType<Duration>(new DateTime.fromMillisecondsSinceEpoch(1000)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(0)));
+ Expect.runtimeIsType<Duration>(new DateTime.fromMillisecondsSinceEpoch(0)
+ .difference(new DateTime.fromMillisecondsSinceEpoch(1000)));
}
diff --git a/LibTest/core/DateTime/hashCode_A01_t01.dart b/LibTest/core/DateTime/hashCode_A01_t01.dart
index 6d37b36..2d8fcdd 100644
--- a/LibTest/core/DateTime/hashCode_A01_t01.dart
+++ b/LibTest/core/DateTime/hashCode_A01_t01.dart
@@ -20,6 +20,8 @@
var h2 = date2.hashCode;
Expect.isTrue(h1 is int);
Expect.isTrue(h2 is int);
+ Expect.runtimeIsType<int>(h1);
+ Expect.runtimeIsType<int>(h2);
if (date1 == date2) {
Expect.equals(h1, h2);
}
diff --git a/LibTest/core/DateTime/hour_A01_t01.dart b/LibTest/core/DateTime/hour_A01_t01.dart
index e72fc5b..e6c0aeb 100644
--- a/LibTest/core/DateTime/hour_A01_t01.dart
+++ b/LibTest/core/DateTime/hour_A01_t01.dart
@@ -19,5 +19,6 @@
void check(int h) {
DateTime date = new DateTime(2011, 1, 1, h, 0, 0, 0);
Expect.isTrue(date.hour is int);
+ Expect.runtimeIsType<int>(date.hour);
Expect.equals(h, date.hour);
}
diff --git a/LibTest/core/DateTime/microsecond_A01_t01.dart b/LibTest/core/DateTime/microsecond_A01_t01.dart
index ec09efb..464d7c6 100644
--- a/LibTest/core/DateTime/microsecond_A01_t01.dart
+++ b/LibTest/core/DateTime/microsecond_A01_t01.dart
@@ -19,5 +19,6 @@
void check(int us) {
DateTime date = new DateTime(2011, 1, 1, 0, 0, 0, 0, us);
Expect.isTrue(date.microsecond is int);
+ Expect.runtimeIsType<int>(date.microsecond);
Expect.equals(us, date.microsecond);
}
diff --git a/LibTest/core/DateTime/millisecond_A01_t01.dart b/LibTest/core/DateTime/millisecond_A01_t01.dart
index 551aebc..4dbe237 100644
--- a/LibTest/core/DateTime/millisecond_A01_t01.dart
+++ b/LibTest/core/DateTime/millisecond_A01_t01.dart
@@ -20,5 +20,6 @@
void check(int ms) {
DateTime date = new DateTime(2011, 1, 1, 0, 0, 0, ms);
Expect.isTrue(date.millisecond is int);
+ Expect.runtimeIsType<int>(date.millisecond);
Expect.equals(ms, date.millisecond);
}
diff --git a/LibTest/core/DateTime/minute_A01_t01.dart b/LibTest/core/DateTime/minute_A01_t01.dart
index 333b44f..565c017 100644
--- a/LibTest/core/DateTime/minute_A01_t01.dart
+++ b/LibTest/core/DateTime/minute_A01_t01.dart
@@ -20,5 +20,6 @@
void check(int m) {
DateTime date = new DateTime(2011, 1, 1, 0, m, 0, 0);
Expect.isTrue(date.minute is int);
+ Expect.runtimeIsType<int>(date.minute);
Expect.equals(m, date.minute);
}
diff --git a/LibTest/core/DateTime/month_A01_t01.dart b/LibTest/core/DateTime/month_A01_t01.dart
index b5af2c5..3dc594c 100644
--- a/LibTest/core/DateTime/month_A01_t01.dart
+++ b/LibTest/core/DateTime/month_A01_t01.dart
@@ -31,5 +31,6 @@
void check(int m) {
DateTime date = new DateTime(2011, m, 18, 0, 0, 0, 0);
Expect.isTrue(date.month is int);
+ Expect.runtimeIsType<int>(date.month);
Expect.equals(m, date.month);
}
diff --git a/LibTest/core/DateTime/second_A01_t01.dart b/LibTest/core/DateTime/second_A01_t01.dart
index 4011ddc..212d878 100644
--- a/LibTest/core/DateTime/second_A01_t01.dart
+++ b/LibTest/core/DateTime/second_A01_t01.dart
@@ -20,5 +20,6 @@
void check(int s) {
DateTime date = new DateTime(2011, 1, 1, 0, 0, s, 0);
Expect.isTrue(date.second is int);
+ Expect.runtimeIsType<int>(date.second);
Expect.equals(s, date.second);
}
diff --git a/LibTest/core/DateTime/subtract_A01_t01.dart b/LibTest/core/DateTime/subtract_A01_t01.dart
index 5386eeb..02123ab 100644
--- a/LibTest/core/DateTime/subtract_A01_t01.dart
+++ b/LibTest/core/DateTime/subtract_A01_t01.dart
@@ -3,14 +3,42 @@
// BSD-style license that can be found in the LICENSE file.
/// @assertion DateTime subtract(Duration duration)
-/// Returns a new DateTime with the duration subtracted from this.
+/// Returns a new DateTime with the duration subtracted from this.
/// @description Checks that the method returns DateTime instance
/// @author hlodvig
import "../../../Utils/expect.dart";
main() {
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(days: -100000, hours: -100000, minutes: -100000, seconds: -100000, milliseconds: -100000)) is DateTime);
- Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(days: 100000, hours: 100000, minutes: 100000, seconds: 100000, milliseconds: 100000)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(
+ days: -100000,
+ hours: -100000,
+ minutes: -100000,
+ seconds: -100000,
+ milliseconds: -100000)) is DateTime);
+ Expect.isTrue(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(new Duration(
+ days: 100000,
+ hours: 100000,
+ minutes: 100000,
+ seconds: 100000,
+ milliseconds: 100000)) is DateTime);
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(
+ new Duration(
+ days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0)));
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(
+ new Duration(
+ days: -100000,
+ hours: -100000,
+ minutes: -100000,
+ seconds: -100000,
+ milliseconds: -100000)));
+ Expect.runtimeIsType<DateTime>(new DateTime(2001, 8, 18, 0, 0, 0, 0).subtract(
+ new Duration(
+ days: 100000,
+ hours: 100000,
+ minutes: 100000,
+ seconds: 100000,
+ milliseconds: 100000)));
}
diff --git a/LibTest/core/DateTime/timeZoneName_A01_t01.dart b/LibTest/core/DateTime/timeZoneName_A01_t01.dart
index 2338526..beec628 100644
--- a/LibTest/core/DateTime/timeZoneName_A01_t01.dart
+++ b/LibTest/core/DateTime/timeZoneName_A01_t01.dart
@@ -11,7 +11,13 @@
main() {
Expect.isTrue(new DateTime.now().timeZoneName is String);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true).timeZoneName is String);
- Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0, isUtc: false).timeZoneName is String);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true)
+ .timeZoneName is String);
+ Expect.isTrue(new DateTime.fromMillisecondsSinceEpoch(0, isUtc: false)
+ .timeZoneName is String);
+ Expect.runtimeIsType<String>(new DateTime.now().timeZoneName);
+ Expect.runtimeIsType<String>(
+ new DateTime.fromMillisecondsSinceEpoch(0, isUtc: true).timeZoneName);
+ Expect.runtimeIsType<String>(
+ new DateTime.fromMillisecondsSinceEpoch(0, isUtc: false).timeZoneName);
}
-
diff --git a/LibTest/core/DateTime/toString_A01_t01.dart b/LibTest/core/DateTime/toString_A01_t01.dart
index d150364..463acd7 100644
--- a/LibTest/core/DateTime/toString_A01_t01.dart
+++ b/LibTest/core/DateTime/toString_A01_t01.dart
@@ -12,4 +12,5 @@
main() {
Expect.isTrue(new DateTime.now().toString() is String);
+ Expect.runtimeIsType<String>(new DateTime.now().toString());
}
diff --git a/LibTest/core/DateTime/year_A01_t01.dart b/LibTest/core/DateTime/year_A01_t01.dart
index 6b1ff77..5f5b70e 100644
--- a/LibTest/core/DateTime/year_A01_t01.dart
+++ b/LibTest/core/DateTime/year_A01_t01.dart
@@ -22,5 +22,6 @@
void check(int y) {
DateTime date = new DateTime.utc(y, 8, 18, 0, 0, 0, 0);
Expect.isTrue(date.year is int);
+ Expect.runtimeIsType<int>(date.year);
Expect.equals(y, date.year);
}
diff --git a/LibTest/core/Duration/compareTo_A01_t01.dart b/LibTest/core/Duration/compareTo_A01_t01.dart
index a2e6935..acb6ac0 100644
--- a/LibTest/core/Duration/compareTo_A01_t01.dart
+++ b/LibTest/core/Duration/compareTo_A01_t01.dart
@@ -11,5 +11,7 @@
main() {
Expect.isTrue(
new Duration(days: 1, hours: 1, minutes: 1, seconds: 1, milliseconds: 1)
- is Comparable);
+ is Comparable);
+ Expect.runtimeIsType<Comparable>(
+ new Duration(days: 1, hours: 1, minutes: 1, seconds: 1, milliseconds: 1));
}
diff --git a/LibTest/core/Expando/operator_square_brackets_A02_t02.dart b/LibTest/core/Expando/operator_square_brackets_A02_t02.dart
index 4ee9b57..82195f5 100644
--- a/LibTest/core/Expando/operator_square_brackets_A02_t02.dart
+++ b/LibTest/core/Expando/operator_square_brackets_A02_t02.dart
@@ -15,10 +15,14 @@
var exp2 = new Expando("2");
Expect.isTrue(exp.toString() is String);
Expect.isTrue(exp2.toString() is String);
+ Expect.runtimeIsType<String>(exp.toString());
+ Expect.runtimeIsType<String>(exp2.toString());
var o1 = new Object();
exp[o1] = "1";
exp2[o1] = "2";
Expect.isTrue(exp.toString() is String);
Expect.isTrue(exp2.toString() is String);
+ Expect.runtimeIsType<String>(exp.toString());
+ Expect.runtimeIsType<String>(exp2.toString());
}
diff --git a/LibTest/core/FallThroughError/toString_A01_t01.dart b/LibTest/core/FallThroughError/toString_A01_t01.dart
index f83976d..5c6d1c0 100644
--- a/LibTest/core/FallThroughError/toString_A01_t01.dart
+++ b/LibTest/core/FallThroughError/toString_A01_t01.dart
@@ -13,7 +13,8 @@
try {
throw new FallThroughError();
} on FallThroughError catch(e) {
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
}
diff --git a/LibTest/core/FormatException/toString_A01_t01.dart b/LibTest/core/FormatException/toString_A01_t01.dart
index fabd386..84088d0 100644
--- a/LibTest/core/FormatException/toString_A01_t01.dart
+++ b/LibTest/core/FormatException/toString_A01_t01.dart
@@ -12,10 +12,12 @@
main() {
FormatException e = new FormatException();
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
FormatException s = new FormatException("FormatException");
- Expect.isTrue(s.toString() != null);
+ Expect.isTrue(s.toString().isNotEmpty);
Expect.isTrue(s.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/Function/Function_class_A01_t01.dart b/LibTest/core/Function/Function_class_A01_t01.dart
index bbdba6f..0013097 100644
--- a/LibTest/core/Function/Function_class_A01_t01.dart
+++ b/LibTest/core/Function/Function_class_A01_t01.dart
@@ -21,4 +21,8 @@
Expect.isTrue(foo1 is Function);
Expect.isTrue((int, double) { return 1; } is Function);
Expect.isTrue((() => 1) is Function);
+ Expect.runtimeIsType<Function>(foo);
+ Expect.runtimeIsType<Function>(foo1);
+ Expect.runtimeIsType<Function>((int, double) { return 1; });
+ Expect.runtimeIsType<Function>((() => 1));
}
diff --git a/LibTest/core/IntegerDivisionByZeroException/IntegerDivisionByZeroException_A01_t01.dart b/LibTest/core/IntegerDivisionByZeroException/IntegerDivisionByZeroException_A01_t01.dart
index 6d3d0a6..5afccd2 100644
--- a/LibTest/core/IntegerDivisionByZeroException/IntegerDivisionByZeroException_A01_t01.dart
+++ b/LibTest/core/IntegerDivisionByZeroException/IntegerDivisionByZeroException_A01_t01.dart
@@ -6,7 +6,6 @@
/// @description Checks that this constructor executes without error.
/// @author rodionov
-
main() {
new IntegerDivisionByZeroException();
}
diff --git a/LibTest/core/IntegerDivisionByZeroException/toString_A01_t01.dart b/LibTest/core/IntegerDivisionByZeroException/toString_A01_t01.dart
index 709002c..755c191 100644
--- a/LibTest/core/IntegerDivisionByZeroException/toString_A01_t01.dart
+++ b/LibTest/core/IntegerDivisionByZeroException/toString_A01_t01.dart
@@ -11,6 +11,7 @@
main() {
IntegerDivisionByZeroException e = new IntegerDivisionByZeroException();
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/List/remove_A01_t01.test.dart b/LibTest/core/List/remove_A01_t01.test.dart
index d305119..dfe0e83 100644
--- a/LibTest/core/List/remove_A01_t01.test.dart
+++ b/LibTest/core/List/remove_A01_t01.test.dart
@@ -19,6 +19,7 @@
bool r = a.remove(value);
Expect.isTrue(r is bool, "remove returned: ${r.runtimeType} ${r}, not bool");
+ Expect.runtimeIsType<bool>(r);
if (r) {
Expect.isTrue(expected);
Expect.equals(a0.length-1, a.length);
diff --git a/LibTest/core/NoSuchMethodError/toString_A01_t01.dart b/LibTest/core/NoSuchMethodError/toString_A01_t01.dart
index 18135b9..fbc46cf 100644
--- a/LibTest/core/NoSuchMethodError/toString_A01_t01.dart
+++ b/LibTest/core/NoSuchMethodError/toString_A01_t01.dart
@@ -12,6 +12,7 @@
main() {
var symb = new Symbol('');
NoSuchMethodError e = new NoSuchMethodError(null, symb, [], {});
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/Null/Null_class_A01_t01.dart b/LibTest/core/Null/Null_class_A01_t01.dart
index 661eb22..272fd4d 100644
--- a/LibTest/core/Null/Null_class_A01_t01.dart
+++ b/LibTest/core/Null/Null_class_A01_t01.dart
@@ -12,4 +12,5 @@
main() {
Expect.isTrue(null is Null);
+ Expect.runtimeIsType<Null>(null);
}
diff --git a/LibTest/core/OutOfMemoryError/toString_A01_t01.dart b/LibTest/core/OutOfMemoryError/toString_A01_t01.dart
index 2c68a70..9c897e2 100644
--- a/LibTest/core/OutOfMemoryError/toString_A01_t01.dart
+++ b/LibTest/core/OutOfMemoryError/toString_A01_t01.dart
@@ -11,6 +11,7 @@
main() {
OutOfMemoryError e = new OutOfMemoryError();
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/RangeError/toString_A01_t01.dart b/LibTest/core/RangeError/toString_A01_t01.dart
index 131432f..f9bfc92 100644
--- a/LibTest/core/RangeError/toString_A01_t01.dart
+++ b/LibTest/core/RangeError/toString_A01_t01.dart
@@ -12,6 +12,7 @@
main() {
RangeError e = new RangeError(-1);
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/RuneIterator/RuneIterator.at_A01_t01.dart b/LibTest/core/RuneIterator/RuneIterator.at_A01_t01.dart
index f93e035..d1c623c 100644
--- a/LibTest/core/RuneIterator/RuneIterator.at_A01_t01.dart
+++ b/LibTest/core/RuneIterator/RuneIterator.at_A01_t01.dart
@@ -12,6 +12,7 @@
check(string, pos, firstCodePoint) {
var it = new RuneIterator.at(string, pos);
Expect.isTrue(it is RuneIterator);
+ Expect.runtimeIsType<RuneIterator>(it);
it.moveNext();
Expect.equals(firstCodePoint, it.current);
}
diff --git a/LibTest/core/RuneIterator/RuneIterator_A01_t01.dart b/LibTest/core/RuneIterator/RuneIterator_A01_t01.dart
index 3400283..429e752 100644
--- a/LibTest/core/RuneIterator/RuneIterator_A01_t01.dart
+++ b/LibTest/core/RuneIterator/RuneIterator_A01_t01.dart
@@ -13,6 +13,7 @@
check(string, firstCodePoint) {
var it = new RuneIterator(string);
Expect.isTrue(it is RuneIterator);
+ Expect.runtimeIsType<RuneIterator>(it);
it.moveNext();
Expect.equals(firstCodePoint, it.current);
}
diff --git a/LibTest/core/Runes/Runes_A01_t01.dart b/LibTest/core/Runes/Runes_A01_t01.dart
index 0043165..9ba6502 100644
--- a/LibTest/core/Runes/Runes_A01_t01.dart
+++ b/LibTest/core/Runes/Runes_A01_t01.dart
@@ -11,6 +11,7 @@
check(string) {
var runes = new Runes(string);
Expect.isTrue(runes is Runes);
+ Expect.runtimeIsType<Runes>(runes);
}
main() {
diff --git a/LibTest/core/Set/Set_A01_t01.dart b/LibTest/core/Set/Set_A01_t01.dart
index 7ab2f35..b159efe 100644
--- a/LibTest/core/Set/Set_A01_t01.dart
+++ b/LibTest/core/Set/Set_A01_t01.dart
@@ -11,5 +11,6 @@
main() {
Set s = new Set();
Expect.isTrue(s is Set);
+ Expect.runtimeIsType<Set>(s);
Expect.isTrue(s.isEmpty);
}
diff --git a/LibTest/core/StackOverflowError/toString_A01_t01.dart b/LibTest/core/StackOverflowError/toString_A01_t01.dart
index 5e37479..ec07557 100644
--- a/LibTest/core/StackOverflowError/toString_A01_t01.dart
+++ b/LibTest/core/StackOverflowError/toString_A01_t01.dart
@@ -12,6 +12,7 @@
main() {
StackOverflowError e = new StackOverflowError();
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/StateError/toString_A01_t01.dart b/LibTest/core/StateError/toString_A01_t01.dart
index bd9b0af..4e29665 100644
--- a/LibTest/core/StateError/toString_A01_t01.dart
+++ b/LibTest/core/StateError/toString_A01_t01.dart
@@ -11,6 +11,7 @@
main() {
StateError e = new StateError("");
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/String/String_class_A03_t01.dart b/LibTest/core/String/String_class_A03_t01.dart
index 8da6d13..2ca1a1e 100644
--- a/LibTest/core/String/String_class_A03_t01.dart
+++ b/LibTest/core/String/String_class_A03_t01.dart
@@ -10,7 +10,8 @@
main() {
String s = new String.fromCharCodes([0x61, 0x62, 0x63]);
-
Expect.isTrue(s is Comparable);
Expect.isTrue(s is Pattern);
+ Expect.runtimeIsType<Comparable>(s);
+ Expect.runtimeIsType<Pattern>(s);
}
diff --git a/LibTest/core/TypeError/toString_A01_t01.dart b/LibTest/core/TypeError/toString_A01_t01.dart
index b24a573..8cee04d 100644
--- a/LibTest/core/TypeError/toString_A01_t01.dart
+++ b/LibTest/core/TypeError/toString_A01_t01.dart
@@ -15,10 +15,12 @@
int x = i;
Expect.fail("TypeError expected");
} on TypeError catch(e) {
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
} on CastError catch(e) {
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
}
diff --git a/LibTest/core/UnimplementedError/toString_A01_t01.dart b/LibTest/core/UnimplementedError/toString_A01_t01.dart
index 0867d72..854bd60 100644
--- a/LibTest/core/UnimplementedError/toString_A01_t01.dart
+++ b/LibTest/core/UnimplementedError/toString_A01_t01.dart
@@ -11,6 +11,7 @@
main() {
UnimplementedError e = new UnimplementedError();
- Expect.isTrue(e.toString() != null);
+ Expect.isTrue(e.toString().isNotEmpty);
Expect.isTrue(e.toString() is String);
+ Expect.runtimeIsType<String>(e.toString());
}
diff --git a/LibTest/core/double/INFINITY_A01_t04.dart b/LibTest/core/double/INFINITY_A01_t04.dart
index 0dcac03..d7a8bb2 100644
--- a/LibTest/core/double/INFINITY_A01_t04.dart
+++ b/LibTest/core/double/INFINITY_A01_t04.dart
@@ -10,5 +10,5 @@
main() {
Expect.isTrue(double.infinity is double);
- Expect.isTrue(double.infinity is num);
+ Expect.runtimeIsType<double>(double.infinity);
}
diff --git a/LibTest/core/double/NAN_A01_t04.dart b/LibTest/core/double/NAN_A01_t04.dart
index 61df5e2..c58222e 100644
--- a/LibTest/core/double/NAN_A01_t04.dart
+++ b/LibTest/core/double/NAN_A01_t04.dart
@@ -11,5 +11,6 @@
main() {
Expect.isFalse(double.nan is int);
Expect.isTrue(double.nan is double);
- Expect.isTrue(double.nan is num);
+ Expect.runtimeIsNotType<int>(double.nan);
+ Expect.runtimeIsType<double>(double.nan);
}
diff --git a/LibTest/core/double/NEGATIVE_INFINITY_A01_t04.dart b/LibTest/core/double/NEGATIVE_INFINITY_A01_t04.dart
index 376b161..ce92d9b 100644
--- a/LibTest/core/double/NEGATIVE_INFINITY_A01_t04.dart
+++ b/LibTest/core/double/NEGATIVE_INFINITY_A01_t04.dart
@@ -10,5 +10,5 @@
main() {
Expect.isTrue(double.negativeInfinity is double);
- Expect.isTrue(double.negativeInfinity is num);
+ Expect.runtimeIsType<double>(double.negativeInfinity);
}
diff --git a/LibTest/core/double/toInt_A01_t05.dart b/LibTest/core/double/toInt_A01_t05.dart
index 84e97ec..90ecd78 100644
--- a/LibTest/core/double/toInt_A01_t05.dart
+++ b/LibTest/core/double/toInt_A01_t05.dart
@@ -15,6 +15,7 @@
check(double arg) {
var v = arg.toInt();
Expect.isTrue(v is int);
+ Expect.runtimeIsType<int>(v);
Expect.equals(v, arg);
}
diff --git a/LibTest/core/int/operator_division_A02_t01.dart b/LibTest/core/int/operator_division_A02_t01.dart
index edb832f..80abe69 100644
--- a/LibTest/core/int/operator_division_A02_t01.dart
+++ b/LibTest/core/int/operator_division_A02_t01.dart
@@ -18,5 +18,13 @@
Expect.isTrue(1/0 is double);
Expect.isTrue(-1/0 is double);
Expect.isTrue(0/0 is double);
+ Expect.runtimeIsType<double>(1/2);
+ Expect.runtimeIsType<double>(2/1);
+ Expect.runtimeIsType<double>(-2/1);
+ Expect.runtimeIsType<double>(1/1);
+ Expect.runtimeIsType<double>(20/10);
+ Expect.runtimeIsType<double>(1/0);
+ Expect.runtimeIsType<double>(-1/0);
+ Expect.runtimeIsType<double>(0/0);
}
diff --git a/LibTest/core/int/operator_remainder_A01_t02.dart b/LibTest/core/int/operator_remainder_A01_t02.dart
index 85250d4..df54813 100644
--- a/LibTest/core/int/operator_remainder_A01_t02.dart
+++ b/LibTest/core/int/operator_remainder_A01_t02.dart
@@ -51,4 +51,5 @@
void check(num ex, int a, double b) {
Expect.equals(ex, a % b);
Expect.isTrue((a % b) is double);
+ Expect.runtimeIsType<double>((a % b));
}
diff --git a/LibTest/core/int/remainder_A01_t02.dart b/LibTest/core/int/remainder_A01_t02.dart
index dc00f9e..16fbb17 100644
--- a/LibTest/core/int/remainder_A01_t02.dart
+++ b/LibTest/core/int/remainder_A01_t02.dart
@@ -57,5 +57,6 @@
void check(num ex, int a, double b) {
Expect.equals(ex, a.remainder(b));
- Expect.isTrue((a.remainder(b)) is double);
+ Expect.isTrue(a.remainder(b) is double);
+ Expect.runtimeIsType<double>(a.remainder(b));
}
diff --git a/LibTest/ffi/DartRepresentationOf/DartRepresentationOf_A01_t01.dart b/LibTest/ffi/DartRepresentationOf/DartRepresentationOf_A01_t01.dart
index 31cb9a4..a4be6cc 100644
--- a/LibTest/ffi/DartRepresentationOf/DartRepresentationOf_A01_t01.dart
+++ b/LibTest/ffi/DartRepresentationOf/DartRepresentationOf_A01_t01.dart
@@ -12,10 +12,12 @@
import "../../../Utils/expect.dart";
void main() {
- DartRepresentationOf o1 = new DartRepresentationOf("");
+ var o1 = new DartRepresentationOf("");
Expect.isTrue(o1 is DartRepresentationOf);
+ Expect.runtimeIsType<DartRepresentationOf>(o1);
DartRepresentationOf o2 = new DartRepresentationOf("Double");
Expect.isTrue(o2 is DartRepresentationOf);
+ Expect.runtimeIsType<DartRepresentationOf>(o2);
Expect.equals("DartRepresentationOf", o2.runtimeType.toString());
}
diff --git a/LibTest/ffi/Dart_CObject/Dart_CObject_A01_t01.dart b/LibTest/ffi/Dart_CObject/Dart_CObject_A01_t01.dart
index 92dccdf..d7b1968 100644
--- a/LibTest/ffi/Dart_CObject/Dart_CObject_A01_t01.dart
+++ b/LibTest/ffi/Dart_CObject/Dart_CObject_A01_t01.dart
@@ -11,7 +11,9 @@
import "../../../Utils/expect.dart";
void main() {
- Dart_CObject o = new Dart_CObject();
+ var o = new Dart_CObject();
Expect.isTrue(o is Dart_CObject);
Expect.isTrue(o is Opaque);
+ Expect.runtimeIsType<Dart_CObject>(o);
+ Expect.runtimeIsType<Opaque>(o);
}
diff --git a/LibTest/html/Document/window_A01_t01.dart b/LibTest/html/Document/window_A01_t01.dart
index 68a9661..509752a 100644
--- a/LibTest/html/Document/window_A01_t01.dart
+++ b/LibTest/html/Document/window_A01_t01.dart
@@ -11,4 +11,5 @@
main() {
WindowBase? window = document.window;
Expect.isTrue(window is WindowBase?);
+ Expect.runtimeIsType<WindowBase?>(window);
}
diff --git a/LibTest/html/Node/childNodes_A01_t01.dart b/LibTest/html/Node/childNodes_A01_t01.dart
index c8919bd..4b46383 100644
--- a/LibTest/html/Node/childNodes_A01_t01.dart
+++ b/LibTest/html/Node/childNodes_A01_t01.dart
@@ -12,6 +12,7 @@
void check(Node x) {
var z = x.childNodes;
Expect.isTrue(z is List);
+ Expect.runtimeIsType<List>(z);
}
main() {
diff --git a/LibTest/html/Window/open_A01_t01.dart b/LibTest/html/Window/open_A01_t01.dart
index f03998f..66e2266 100644
--- a/LibTest/html/Window/open_A01_t01.dart
+++ b/LibTest/html/Window/open_A01_t01.dart
@@ -10,7 +10,8 @@
import "../../../Utils/expect.dart";
main() {
- WindowBase nw = window.open("about:blank", "_blank");
+ var nw = window.open("about:blank", "_blank");
Expect.isTrue(nw is WindowBase);
+ Expect.runtimeIsType<WindowBase>(nw);
nw.close();
}
diff --git a/Utils/expect_common.dart b/Utils/expect_common.dart
index 9c0046d..cef6c63 100644
--- a/Utils/expect_common.dart
+++ b/Utils/expect_common.dart
@@ -312,8 +312,8 @@
/// If you want to test not only compiler optimization but runtime as well the
/// use
/// ```dart
- /// Expect.isTrue(c is C);
- /// Expect.runtimeIsType<C>(c);
+ /// Expect.isTrue(c is C); // to test optimization
+ /// Expect.runtimeIsType<C>(c); // to test runtime
static void runtimeIsType<T>(Object? o) {
_checkType(_checkIs<T>, true, o);
}
@@ -324,8 +324,8 @@
/// If you want to test not only compiler optimization but runtime as well the
/// use
/// ```dart
- /// Expect.isFalse(c is C);
- /// Expect.runtimeIsNotType<C>(c);
+ /// Expect.isFalse(c is C); // to test optimization
+ /// Expect.runtimeIsNotType<C>(c); // to test runtime
static void runtimeIsNotType<T>(Object? o) {
_checkType(_checkIs<T>, false, o);
}