Commit Graph

19 Commits

Author SHA1 Message Date
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Max Desiatov
372ada0e24 test: add handling for Wasm/WASI (#39519)
This change adds support for WASI in stdlib tests. Some tests that expect a crash to happen had to be disabled, since there's currently no way to observe such crash from a WASI host.
2022-01-12 14:24:50 +00:00
Tim Kientzle
affca54411 Fix back-deployment tests
Segregate out a couple of tests that verify changed behaviors in
the standard library so we can omit them when testing against older
runtimes.
2020-11-16 16:49:34 -08:00
tbkka
5d30503894 When parsing floating-point from String, underflow to 0, overflow to infinity (#34339)
Previously, overflow and underflow both caused this to return `nil`, which causes several problems:
* It does not distinguish between a large but valid input and a malformed input.  `Float("3.402824e+38")` is perfectly well-formed but returns nil
* It differs from how the compiler handles literals.  As a result, `Float(3.402824e+38)` is very different from `Float("3.402824e+38")`
* It's inconsistent with Foundation Scanner()
* It's inconsistent with other programming languages

This is exactly the same as #25313

Fixes rdar://problem/36990878
2020-10-19 09:44:57 -04:00
Saleem Abdulrasool
a817409562 test: make stdlib.NumericParsing Python 3 friendly
Use the proper division operation as the test otherwise generates
different patterns.
2020-06-29 08:55:01 -07:00
Saleem Abdulrasool
7ca074bd07 test: port most of the stdlib tests to Windows
This adjusts the standard library test suite to mostly pass on Windows.
The remaining failures are due to various cases:

- memory corruption (`_swift_stdlib_free` in swiftDemangle)
- heap corruption (canGrowUsingRealloc)
- withVAList failure (unresolved)
- unicode handling on the command line
2019-01-15 09:19:06 -08:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Xiaodi Wu
bd32fba236 Add generic FixedWidthInteger test 2018-01-06 03:27:18 -06:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Max Moiseev
b9fb3badc8 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-03-22 12:30:24 -07:00
David Hart
66131c01d3 [SR-2626] Fix String to Float/Double “snan” conversion (#8036)
Adds an explicit check for `[+-]snan` to create an sNaN from a string.
2017-03-13 21:07:31 -04:00
Max Moiseev
835b8809d2 Merge branch 'master' into new-integer-protocols 2017-03-07 16:18:54 -08:00
Maxim Moiseev
751d61a694 [test] Making NumericParsing.swift.gyb Python 3 compatible (#7437)
Should fix: https://bugs.swift.org/browse/SR-520
2017-02-13 15:17:45 -08:00
Max Moiseev
d71c73bbba Fixing stdlib tests 2017-01-06 18:08:36 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Max Moiseev
9fc37efee4 [test] renaming test/1_stdlib to just test/stdlib 2016-09-01 16:51:43 -07:00