dart-sdk/tests/corelib_2/hash_set_type_check_test.dart
Kevin Moore c347b0ed16 Migrate test block 9 to Dart 2.0
Deleted http_resource_test – the associated classes no longer exist
Deleted int_fromEnvironment3 - validated type semantics
Tweaked hash_set_type_check – made it very simple.

Also tweaked some analyzer hints

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2990623002 .
2017-07-25 16:43:08 -07:00

31 lines
1.1 KiB
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// 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.
// Tests of hash set type checking.
library hash_set_type_check_test;
import "package:expect/expect.dart";
import 'dart:collection';
// TODO: all this test does now is verify that lookup takes a non-T
// should merge this with `hash_test_test`.
testSet(Set<String> newSet()) {
Set<String> s = newSet();
Expect.isNull(s.lookup(1));
}
void main() {
testSet(() => new Set<String>());
testSet(() => new HashSet<String>());
testSet(() => new LinkedHashSet<String>());
testSet(() => new Set<String>.identity());
testSet(() => new HashSet<String>.identity());
testSet(() => new LinkedHashSet<String>.identity());
testSet(() => new HashSet<String>(
equals: (x, y) => identical(x, y), hashCode: (x) => identityHashCode(x)));
testSet(() => new LinkedHashSet<String>(
equals: (x, y) => identical(x, y), hashCode: (x) => identityHashCode(x)));
}