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

Side by Side Diff: tests/standalone_2/float_array_static_test.dart

Issue 2984363004: Migrate first block of tests in standalone to standalone_2 (Closed)
Patch Set: Remove Expect.throws Created 3 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // Dart test program for testing native float arrays.
6
7 // VMOptions=--optimization_counter_threshold=10 --no-background_compilation
8
9 // Library tag to be able to run in html test framework.
10 library FloatArrayTest;
11
12 import "package:expect/expect.dart";
13 import 'dart:typed_data';
14
15 void testIndexOf32() {
16 var list = new Float32List(10);
17 for (int i = 0; i < list.length; i++) {
18 list[i] = i + 10.0;
19 }
20 /*@compile-error=unspecified*/ Expect.equals(0, list.indexOf(10));
21 /*@compile-error=unspecified*/ Expect.equals(5, list.indexOf(15));
22 /*@compile-error=unspecified*/ Expect.equals(9, list.indexOf(19));
23 /*@compile-error=unspecified*/ Expect.equals(-1, list.indexOf(20));
24 }
25
26 void testBadValues32() {
27 var list = new Float32List(10);
28 list[0] = 2.0;
29 /*@compile-error=unspecified*/ list[0] = 2;
30 /*@compile-error=unspecified*/ list[0] = "hello";
31 }
32
33 void testIndexOf64() {
34 var list = new Float64List(10);
35 for (int i = 0; i < list.length; i++) {
36 list[i] = i + 10.0;
37 }
38 /*@compile-error=unspecified*/ Expect.equals(0, list.indexOf(10));
39 /*@compile-error=unspecified*/ Expect.equals(5, list.indexOf(15));
40 /*@compile-error=unspecified*/ Expect.equals(9, list.indexOf(19));
41 /*@compile-error=unspecified*/ Expect.equals(-1, list.indexOf(20));
42 }
43
44 void testBadValues64() {
45 var list = new Float64List(10);
46 list[0] = 2.0;
47 /*@compile-error=unspecified*/ list[0] = 2;
48 /*@compile-error=unspecified*/ list[0] = "hello";
49 }
50
51 main() {
52 testIndexOf32();
53 testIndexOf64();
54 testBadValues32();
55 testBadValues64();
56 }
OLDNEW
« no previous file with comments | « tests/standalone_2/fields_may_be_reset_test.dart ('k') | tests/standalone_2/float_array_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698