Index: packages/quiver/test/core/hash_test.dart |
diff --git a/quiver/lib/testing/src/runtime/checked_mode.dart b/packages/quiver/test/core/hash_test.dart |
similarity index 50% |
rename from quiver/lib/testing/src/runtime/checked_mode.dart |
rename to packages/quiver/test/core/hash_test.dart |
index 05dfaaedac445403b631526fb4b730bbcbcc2ce4..4d1fadca827eefdbc18785abd9bcfc68fbd0eb0d 100644 |
--- a/quiver/lib/testing/src/runtime/checked_mode.dart |
+++ b/packages/quiver/test/core/hash_test.dart |
@@ -12,31 +12,29 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-part of quiver.testing.runtime; |
+library quiver.core.hash_test; |
-/** |
- * Asserts that the current runtime has checked mode enabled. |
- * |
- * Otherwise, throws [StateError]. |
- */ |
-void assertCheckedMode() { |
- if (_isCheckedMode == null) _isCheckedMode = _checkForCheckedMode(); |
+import 'package:quiver/core.dart'; |
+import 'package:test/test.dart'; |
- if (!_isCheckedMode) { |
- throw new StateError('Not in checked mode.'); |
- } |
-} |
+main() { |
+ test('hashObjects should return an int', () { |
+ int h = hashObjects(['123', 456]); |
+ expect(h, new isInstanceOf<int>()); |
+ }); |
+ |
+ test('hash2 should return an int', () { |
+ int h = hash2('123', 456); |
+ expect(h, new isInstanceOf<int>()); |
+ }); |
-bool _isCheckedMode = null; |
+ test('hash3 should return an int', () { |
+ int h = hash3('123', 456, true); |
+ expect(h, new isInstanceOf<int>()); |
+ }); |
-bool _checkForCheckedMode() { |
- Object sentinal = new Object(); |
- try { |
- var i = 1 as dynamic; |
- String string = i; |
- throw sentinal; |
- } catch (e) { |
- if (e == sentinal) return false; |
- } |
- return true; |
+ test('hash4 should return an int', () { |
+ int h = hash4('123', 456, true, []); |
+ expect(h, new isInstanceOf<int>()); |
+ }); |
} |