Commit Graph

78 Commits

Author SHA1 Message Date
Robert Nystrom 8717ff636a Format tests/lib/math/ using 3.8 style.
Change-Id: Ib34bac4962df8927cf2952a4cc5e388c84dcea79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425984
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-05-05 02:23:50 -07:00
Josh Soref 84e3c8b50f Spelling tests
Closes https://github.com/dart-lang/sdk/pull/50920

GitOrigin-RevId: fa87531bd0f52b69485c9d02ff9e44a4a29c6a91
Change-Id: I0ae8574a5b77087895e004079f221201bb550cf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278535
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-19 16:24:29 +00:00
Alexander Markov 24b8399086 [tests] Avoid small --optimization-counter-threshold in tests
Small --optimization-counter-threshold makes tests very slow,
especially on architectures where kernel service runs from
kernel and not from app-jit snapshot.

TEST=change in tests, *-ia32 bots
Fixes https://github.com/dart-lang/sdk/issues/48627

Change-Id: I63e7e201ef9a0e4f645016c39a5be1819b61822d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263421
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-10-10 21:04:18 +00:00
Lasse R.H. Nielsen 19252d5786 Fix behavior for -infinity width/height of rectangles.
Fixes #30186
BUG= dartbug.com/30186

Change-Id: I2994d180a4dc4d4e4bba7edec67bc2bcc2e8fc0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201568
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-06-21 13:29:39 +00:00
Stephen Adams 3205f60a75 Avoid shift in math/random_big_test
Change-Id: Ia9475b6aaa2c5bb7f93c98e0676f83ca7c3762b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175104
Auto-Submit: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-12-04 23:46:34 +00:00
William Hesse 811cb746d3 [tests] Fix CompileTime error in implement_rectangle test.
Fixes: https://github.com/dart-lang/sdk/issues/41541
Change-Id: I46f069145990f548848e6efef9e8d4c9c939adf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144942
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2020-04-27 17:21:26 +00:00
Riley Porter 17f5dcb336 [tests] Fix CompileTimeErrors in migrated tests.
Fixes:
lib/math/rectangle_test
lib/convert/utf8_test
lib/convert/utf8_encode_test
lib/convert/streamed_conversion_utf8_encode_test
lib/convert/streamed_conversion_utf8_decode_test
lib/convert/streamed_conversion_json_utf8_encode_test
lib/convert/streamed_conversion_json_utf8_decode_test
lib/convert/json_lib_test
lib/convert/encoding_test
lib/convert/chunked_conversion_utf8_test
lib/convert/chunked_conversion_utf85_test
lib/convert/chunked_conversion_utf84_test
lib/convert/base64_test/none
Change-Id: I9d540e2bc908ac2ac74e42fc1b2eb4c729371c96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143183
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-13 22:42:51 +00:00
Robert Nystrom 582cec84f4 Set up new test suites for migrating the tests to NNBD.
- Copies corelib_2/a*    -> corelib/
- Copies language_2/ab*  -> language/
- Copies lib_2/math/     -> lib/math/
- Copies standalone_2/a* -> standalone/

And also copies over and renames all of the status files in those
directories.

Then it migrates those tests to be static error free in NNBD.

Finally, adds support to the test_runner for the new suites.

Note that this review is split into multiple patchsets. The first
patchset is a straight copy of the existing files. Then the later
patchsets have the interesting changes.

Change-Id: Icec2ff850a3aee30b653066ac184495d1e3814d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:18:43 +00:00
Bob Nystrom f6ca2c1d8f Remove the Dart 1 tests.
This deletes:

tests/co19
tests/corelib
tests/html
tests/isolate
tests/language
tests/lib

It does not delete tests/standalone because apparently there are tests
in there that are not in standalone_2. (I assume they were added after
the test migration. I don't know why they were added there.)

I have tried to remove references to the old tests from various scripts
and tools but may have missed some. (As you can imagine, grepping for
"lib" does not have the best signal-to-noise ratio.)

"It was a pleasure to burn. It was a special pleasure to see things
eaten, to see things blackened and changed. With the brass nozzle in his
fists, with this great python spitting its venomous kerosene upon the
world, the blood pounded in his head, and his hands were the hands of
some amazing conductor playing all the symphonies of blazing and burning
to bring down the tatters and charcoal ruins of history."

- Ray Bradbury, Fahrenheit 451

Change-Id: If3db4a50e7a5ee25aff8058b1483e2ce8e68424e
Reviewed-on: https://dart-review.googlesource.com/c/75420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-11 23:45:18 +00:00
Ben Konyi adfc7a6b72 Migrated test lock 217 to Dart 2.0.
Fairly simple block, with only minor changes made to lib_2/mirrors tests
needed for strong mode compliance.

BUG=

Review-Url: https://codereview.chromium.org/2997283003 .
2017-08-31 07:47:36 -07:00
Ben Konyi 002ebba6f4 Migrated test block 216 to Dart 2.0.
No changes made to this block.

BUG=
R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2995343002 .
2017-08-31 07:02:53 -07:00
Bob Nystrom 489c96ac2e Re-land beginning Dart 2.0 test migration.
This is similar to:

47985d6dbd
452d2d0840
7af2d86ed3

Except that it also fixes the status for dart2analyzer.

R=jcollins@google.com

Review-Url: https://codereview.chromium.org/2980213002 .
2017-07-17 12:40:18 -07:00
Alexander Aprelev 9882d494db "Set up directories.." commit below broke the buildbot tests, two others are collateral damage.
Revert "Precompiler doesn't report Dart 2.0 static type errors yet."

This reverts commit 7af2d86ed3.

Revert "Move absstract_exact_selector back into the language tests. (#30169)"

This reverts commit 452d2d0840.

Revert "Set up directories for migrated Dart 2.0 tests and migrate a couple. (#30149)"

This reverts commit 47985d6dbd.

R=zra@google.com

BUG:dartbug.com/30171
Review-Url: https://codereview.chromium.org/2979073002 .
2017-07-14 14:43:55 -07:00
Bob Nystrom 47985d6dbd Set up directories for migrated Dart 2.0 tests and migrate a couple. (#30149)
* Set up directories for migrated Dart 2.0 tests and migrate a couple.

- Create new "_2" directories where tests that have been validated as
  ready for Dart 2.0 will end up.
- Create empty status files for each directory.
- Add those directories to the set of default selectors you get when you
  run test.py. This gets the VM bots running them.
- Get the DDC bots running those suites.
- Move abstract_exact_selector_test over to dart2js since it's a
  dart2js-specific regression test and not an actual language test.
- Migrate corelib/apply_test.dart.
- Delete abstract_beats_arguments[2]_test.dart since that code is
  statically wrong in 2.0 and can't be run.

This doesn't get the dart2js bots running the new suites. I'll email
the relevant folks to get help with that.

* Resurrect abstract_beats_arguments_test.dart.

It usefully checked that an implementation reports an warning (now
error) if you construct an abstract class.

Also added support to test.dart to mark a test as expecting to
generate a compile error in the test itself. That way, the status file
reflects what is *wrong* about the current status, not what is *right*.

* Change static error syntax to match front_end notation.

* Migrate abstract_getter_test.
2017-07-14 10:27:37 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Jacob Richman 2dcd56ef43 Format all tests.
There are far too many files here to review everyone carefully.
Spot checking most of the diffs look good as test code is generally written
with less care than application code so lots of ugly formatting get through.
If people notice files where the automated formatting bothers them feel free
to comment indicating file names and I'll move spaces within comments to make
the formatting cleaner and use comments to force block formatting as I have
done for other case where formatting looked bad.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2771453003 .
2017-04-17 14:53:02 -07:00
Stephen Adams 8cadbf4f72 Redo "Remove U+180E from whitespace in js_runtime and tests"
TBR=alanknight@google.com
BUG=

Review-Url: https://codereview.chromium.org/2747983003 .
2017-03-13 21:43:05 -07:00
Stephen Adams 66539fb493 Revert "Remove U+180E from whitespace in js_runtime and tests"
Several VM and browser status updates needed.

TBR=alanknight@google.com
BUG=

Review-Url: https://codereview.chromium.org/2748003002 .
2017-03-13 21:11:10 -07:00
Stephen Adams c6a01283c1 Remove U+180E from whitespace in js_runtime and tests
BUG= https://github.com/dart-lang/sdk/issues/28983
R=alanknight@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2733353002 .
2017-03-13 20:18:19 -07:00
Zachary Anderson 63c4b6b1cb Revert "Remove package:unittest from some tests"
This reverts commit dde47b2aad.

Revert "Update Dartium status for passing test"

This reverts commit d71c70d56d.

Tests failing on dart2js and async_star_pause_test is
passing on Dartium. Need to think about how to update the
status files.

Review-Url: https://codereview.chromium.org/2656503004 .
2017-01-25 11:06:58 -08:00
Zachary Anderson dde47b2aad Remove package:unittest from some tests
package:unittest is deprecated in favor of package:test.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2656743002 .
2017-01-25 08:50:02 -08:00
Florian Schneider 2d5e87482c Fix a test to not expect NaNs to be bitwise identical.
Different implementations may use different bit-patterns for NaN. e.g. NAN from math.h can be different from 0.0/0.0 (which is used in double.dart)

We should assert that NaNs are bitwise identical in general.

BUG=#26887
R=lrn@google.com

Review URL: https://codereview.chromium.org/2247553002 .
2016-08-16 15:57:45 -07:00
Ryan Macnak df4e0d5ac6 ARM/ARM64: Fix smashed CODE_REG in intrinsics with InvokeMathCFunctionInstrs.
X64: Fix smashed ARGS_DESC_REG.

IA32: Remove unnecessary preservation of ICREG.

BUG=http://dartbug.com/26516
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2003403003 .
2016-05-25 10:02:21 -07:00
Srdjan Mitrovic b3405d5ebc Add --no-background-compilation to tests that expect to run code in optimized form
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1759973002 .
2016-03-02 16:30:58 -08:00
Lasse R.H. Nielsen b70109683b Implement cryptographically secure random numbers by using crypto.getRandomValues.
Closes https://github.com/dart-lang/sdk/issues/24687

R=floitsch@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1413923004 .
2015-10-23 11:14:37 +02:00
Regis Crelier 09954546fb Add a 'secure' constructor to Random in dart:math returning a cryptographically
secure random generator which reads from the entropy source provided by the
embedder for every generated random value.
Add a test.
Fixes #1746.

R=lrn@google.com

Review URL: https://codereview.chromium.org/1398453004 .
2015-10-15 10:16:03 -07:00
iposva@google.com 365be3a302 Fix Dartium tests:
- Make arguments to main optional.

Review URL: https://codereview.chromium.org//581263003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40461 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 20:45:06 +00:00
iposva@google.com 2dc9179ece - Prevent flakes in pi_test.dart.
R=zra@google.com

Review URL: https://codereview.chromium.org//583583004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40443 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 16:53:24 +00:00
kevmoo@google.com a68595f903 add isNaN and isNotNaN to matchers
BUG= https://code.google.com/p/dart/issues/detail?id=19302
R=kevmoo@google.com

Review URL: https://codereview.chromium.org//332663002

Patch from Sam Rawlins <srawlins@google.com>.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38745 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 19:12:16 +00:00
zra@google.com eb11b8a7a0 Adds far-branches to arm64.
Also fixes bugs and enables tests.

R=regis@google.com

Review URL: https://codereview.chromium.org//283513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36051 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-12 18:43:08 +00:00
lrn@google.com 1ffd31fcde Fix assert in dart:math/Rectangle.
Didn't pass NaN down the correct path, and failed an assertion.
Added tests.

BUG= http://dartbug.com/17734
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//228533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34822 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-08 13:12:21 +00:00
srdjan@google.com 6d56854a9a Add optimization for pow(base, 0.5) to the other architectures as well.
R=zra@google.com

Review URL: https://codereview.chromium.org//220723017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34717 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 19:44:18 +00:00
lrn@google.com e314fc2671 Make Rectangle and MutableRectangle constructors handle negative lengths.
Now handles negative width/height so that it's equivalent to
   new Rectangle.fromPoints(new Point(left, top),
                            new Point(left + width, top + height))

BUG= http://dartbug.com/16167
R=efortuna@google.com

Review URL: https://codereview.chromium.org//135273009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32736 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-18 10:12:23 +00:00
lrn@google.com d63af4cdc8 Add more complex mixing of random seed.
This changes the sequences generated by Random for a given seed,
since the internal state will not be the same as for the unmixed
seed.
It is consistent between VM and dart2js.

The provided integer seed is hashed as follows:
   uint64 hash = 0;
   while (seed > 0) {
      hash = hash * 1037 + mix64((int64)seed);
      seed >>= 64;
   }
where mix64 mixes the bits of a 64-bit value.
The hash is used to initialize the random generator's internal state.

R=floitsch@google.com, iposva@google.com

Review URL: https://codereview.chromium.org//156533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32412 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 08:42:43 +00:00
lrn@google.com 1c27022d7c Change Rectangle.operator== to compare right/bottom instead of width/height.
BUG= http://dartbug.com/16245
R=efortuna@google.com

Review URL: https://codereview.chromium.org//145973005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32155 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-30 09:54:44 +00:00
iposva@google.com 8db30180b4 Fix http://dartbug.com/16111
- Use all bits from the seed value even if passed a Bigint.
- Fix out of bounds access in BigintOperations.
- Remove obsolete implementation note.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//136453012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31859 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 00:01:55 +00:00
lrn@google.com f0bc9ff077 Change dart2js' Random to honor the seed.
Simulate the same RNG as the VM when a seed is passed.

BUG= http://dartbug.com/15426
R=floitsch@google.com

Review URL: https://codereview.chromium.org//104083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30893 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-05 13:06:47 +00:00
lrn@google.com ef66be8610 Change Expect.identical(NaN, x) to not assume NaNs are identical.
R=floitsch@google.com

Review URL: https://codereview.chromium.org//87953002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30667 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-26 10:32:51 +00:00
efortuna@google.com b447e86bd8 Remove default values for point.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//64373004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30061 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-07 18:29:52 +00:00
floitsch@google.com 35e9ae50d9 Fix warnings in library-tests.
R=lrn@google.com

Review URL: https://codereview.chromium.org//54723007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29756 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 17:01:11 +00:00
efortuna@google.com 4a8d13f0f6 Fix Rectangle test with method name.
BUG=

Review URL: https://codereview.chromium.org//41073004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29205 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 20:48:44 +00:00
efortuna@google.com eaa854b258 Move Rectangle and Point into dart:math.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//25808002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28272 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 17:47:39 +00:00
efortuna@google.com 0b53b15b7d "Reverting 28184"
TBR=blois

BUG=

Review URL: https://codereview.chromium.org//25785003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28186 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 22:13:16 +00:00
efortuna@google.com 837c6b6ee3 Move Point and Rect over to dart:math, to be re-exported by dart:html.
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//25623002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28184 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 21:54:02 +00:00
sra@google.com c068a949fe Revert "Revert "Reinstate type checks in Math.min and Math.max""
Review URL: https://codereview.chromium.org//24918003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27983 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 02:01:43 +00:00
sra@google.com 053eaeb868 Revert "Reinstate type checks in Math.min and Math.max"
Review URL: https://codereview.chromium.org//24911003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27981 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 01:15:58 +00:00
sra@google.com b1e55c556c Reinstate type checks in Math.min and Math.max
See Issue 11906 for discussion.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//23658055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27980 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-27 00:45:08 +00:00
lrn@google.com 5343ef8d32 Add documentation to dart:math pow function.
Also add test, and modify implementation to match on the single case where it didn't.

BUG= http://dartdog.com/1952
R=floitsch@google.com

Review URL: https://codereview.chromium.org//22943005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26347 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 12:23:00 +00:00
srdjan@google.com c891612920 Adapt Random class to be able to run in javascript integer compatibility mode.
R=asiva@google.com, zra@google.com

Review URL: https://codereview.chromium.org//21966003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25753 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 23:07:55 +00:00
srdjan@google.com 71cada8f75 Partitioned min_max_test for checked mode as well.
Review URL: https://codereview.chromium.org//20011002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25319 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 23:19:18 +00:00