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

Unified Diff: packages/quiver/test/core/hash_test.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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
« no previous file with comments | « packages/quiver/test/core/core_test.dart ('k') | packages/quiver/test/core/optional_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>());
+ });
}
« no previous file with comments | « packages/quiver/test/core/core_test.dart ('k') | packages/quiver/test/core/optional_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698