Commit Graph

3262 Commits

Author SHA1 Message Date
Miran
95504caa31 make some tests faster (#9413)
* remove duplicated slow test

* smaller `convex hull`

* smaller sleep

* faster `trtree`

* smaller sleep in `tfuturestream`
2018-10-17 19:46:42 +02:00
Araq
81e33b9d87 make thavlak and tmarkerproc_regression tests take fewer iterations in order to speedup the CIs 2018-10-17 13:20:45 +02:00
Oscar Nihlgård
163e9de3c2 Unicode escape in string literals (#9390) 2018-10-17 00:14:22 +02:00
Andreas Rumpf
0d48bafcf0 fixes a regression about indexing into UncheckedArray 2018-10-16 20:09:12 +02:00
Miran
749dbce4c6 Merge tests into a larger file (part 5 of ∞) (#9368)
* merge magics

* merge metatype tests

* merge method tests

* merge objects tests

* change `import future` to `import sugar`

Nim in Action tests are left with `import future`, to ensure compatibility.

* merge overload tests

* merge proc tests

* merge procvar tests

* merge range tests

* merge seq tests

* merge sets tests

* remove wrong assert from `tsets3`

* fix `jsTests`

* better fix
2018-10-16 10:50:10 +02:00
Araq
0c04da6f26 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2018-10-15 12:20:52 +02:00
Araq
bf01d7136e Merge branch 'Fixes-7845' of https://github.com/cooldome/Nim into cooldome-Fixes-7845 2018-10-15 11:50:12 +02:00
Araq
f8e805a614 fixes #2760 2018-10-15 10:43:56 +02:00
Timothee Cour
3bef851143 fix #8225 os.isHidden was buggy on posix (#8315)
* fix #8225 isHidden was broken on posix

* scope rest of tos.nim under blocks to avoid variable scope bugs
2018-10-15 00:22:34 +02:00
Andreas Rumpf
b39302b0d2 DFA: implement exception handling properly 2018-10-14 17:36:55 +02:00
Miran
a30ba8cc37 merge macros tests (#9367) 2018-10-14 17:08:42 +02:00
LemonBoy
4808ef72db [WIP] Early evaluation of mIs (#8723)
* Early evaluation of mIs

The `evalIs` implementation was just a broken copy of `isOpImpl` so
let's just avoid it alltogether: `mIs` nodes are either resolved during
the semantic phase or bust.

* Remove dead code and tidy it up
2018-10-14 08:53:41 +02:00
Miran
9f8b93641e Merge tests into a larger file (part 3 of ∞: generics) (#9347)
* merge generics issues tests
* merge tgeneric
* merge test with local imports
* merge tcan tests
* merge matcher tests
* more issue tests merged
* one more tcan test
* merge various small tests into one file
* add a test for #3717
2018-10-14 08:50:39 +02:00
Vindaar
afd5abdfc2 add issue #5707 as test case (#9361) 2018-10-14 08:44:57 +02:00
Timothee Cour
eb946f37a7 fixes #8671; show helpful msg (lookup symbol, eg iterator) on 'attempting to call undeclared routine' error (#8786) 2018-10-14 01:16:04 +02:00
Timothee Cour
745f1642d6 implement sizeof and alignof operator (manually squashed #5664) (#9356) 2018-10-14 00:52:28 +02:00
Timothee Cour
3e2d8c1c53 correctly render AST in doAssert/assert condition: fixes #8518; refs #9301 (#9332)
* fixes #8518; refs #9301; correctly render AST in doAssert condition
2018-10-14 00:17:10 +02:00
Miran
d570dea480 put several issues in tests (#9352)
* put several issues in tests

* remove wrong test
2018-10-13 20:17:59 +02:00
Miran
3c9fcc4c30 Merge tests into a larger file (part 2 of ∞) (#9335)
* merge controlflow tests

* merge distinct tests

* merge enum tests

* merge fields tests

* merge implicit tests

* merge iter issues tests
2018-10-13 14:58:31 +02:00
Vindaar
9cdd9be5a5 fixes #8916 by fixing typeinfo and marshal. (#9341)
* fixes #8916 by removing `tyString`, `tySeq`, mod. marshal, typeinfo

Need to check in `typeinfo` for nil of the underlying pointer.
In marshal don't have to check for nil of seq anymore.

* remove reference to string, sequence in `isNil` doc string
2018-10-13 08:47:58 +02:00
Andreas Rumpf
1475697fbf make tests green again 2018-10-13 08:39:56 +02:00
Andreas Rumpf
fcca59e415 destructors: optimize more assignments into moves; also fixes #9294 2018-10-12 20:36:42 +02:00
c-blake
1b3725e395 Add toOpenArray[T](ptr UncheckedArray[T]) for clarity. (#9316)
* Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity.  `ptr array[0,T]`
for some unchecked type already works but A) `UncheckedArray` seems to be
the intended future way for this kind of access, and B) essentially all use
cases will have a `ptr` for that kind of array source and this call signature
lets callers drop the trailing `[]` corresponding to that `ptr` deref.
This PR relates to issue https://github.com/nim-lang/Nim/issues/9001 .

* Add a test for toOpenArray() for UncheckedArray[T]s.
2018-10-12 17:40:07 +02:00
Jacek Sieka
97738a4f28 Testament pre parallel (#9137)
* testament: move to root dir (it's not a test)

* osproc: fix process index passed to afterRunEvent for parallel runs

it was passing the index of the process, not index of all commands

* testament: complete file move
2018-10-12 17:27:47 +02:00
Miran
7f18d7cbc1 Merge tests into a larger file (part 1 of ∞) (#9318)
* merge actiontable tests

* merge arithm tests

* merge array tests

* merge assign tests

* merge bind tests

* merge casestmt tests

* merge closure tests

* merge cnt seq tests

* merge collections tests

* merge concept issues tests

* merge concept tests

* fix failing tests

* smaller outputs

Use `doAssert` where possible.

* fix wrong output

* split `tcomputedgoto`

* revert merging concepts

* fix failing test
2018-10-12 17:02:46 +02:00
LemonBoy
fab4d38411 string to string conversion keeps the dest type (#9323)
Fixes #9322
2018-10-12 08:50:28 +02:00
Konstantin Molchanov
fde4a086c5 8684 add shortcut sort procs (#9174)
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
2018-10-11 22:51:23 +02:00
Araq
d48e964950 fixes #9281 2018-10-11 19:52:48 +02:00
cooldome
7a5b614edc fixes #9297 (#9298)
* fixes #9297

* improve spacing
2018-10-11 09:54:50 +02:00
Timothee Cour
a58c982a49 test case for #9180 and re-enables the disabled tcompilerapi test (#9181)
* add findNimStdLibCompileTime and un-disable tcompilerapi test; add test case for #9180

* address comments
2018-10-11 09:44:35 +02:00
xzfc
8fc7cecfa2 compiler: show name of instantiating context in error traces (#6763) (#9207) 2018-10-11 09:34:56 +02:00
LemonBoy
7775b7efd1 Fix wrong heuristic in codegen (#9293)
A bare return may trigger the insertion of a genericReset.

Fixes #9286
2018-10-11 08:36:05 +02:00
xzfc
8ed3dac1dc Fix tests on NixOS (#9209) (#9285)
* Replace `/bin/sleep` with just `sleep`, i.e. use environment variable
  `$PATH` to locate binary.
* Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined,
  fallback to hardcoded path otherwise. This is the same behavior that
  Glibc2 normally have, see man 3 tzset.
2018-10-10 22:47:08 +02:00
LemonBoy
0ead36dae6 Unchecked arrays now have their own type (#9267) 2018-10-10 21:03:18 +02:00
Andreas Rumpf
0803b532f4 fixes #9263 2018-10-10 21:00:54 +02:00
Miran
462bff48b2 Iter test: closes #3819 (#9272) 2018-10-10 10:21:38 +02:00
LemonBoy
32d5b80938 Fix macro expansion in expandMacros (#8998)
* Fix macro expansion in expandMacros

Running a semanticized node trough the semantic pass was a bad idea.

Fixes #7723

* Simpler smaller implementation
2018-10-09 23:24:54 +02:00
Timothee Cour
63c00d7be9 fix tests/generics/t8694.nim: runnableExamples were not run because of #9216 (#9262) 2018-10-09 21:51:51 +02:00
LemonBoy
33458894da Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448
Fixes #4384
2018-10-09 19:58:23 +02:00
LemonBoy
ee14ace5d3 Field checks for everybody (#8957)
* Field checks for JS backend

* Clean nkCall nodes with no arguments

Generating a nkEmpty in place of no arguments makes no sense form the
AST point of view and also trips up the VM codegen.

* Field checks for VM backend

* Test case for #6612

This patchset fixes #6612

* Add test case for LHS double evaluation

* Prevent LHS double-eval for JS backend

* Prevent double evaluation in VM backend
2018-10-09 19:54:12 +02:00
LemonBoy
a3fb0a769c Try/Catch support for native JS exceptions (#8955)
* Try/Catch support for native JS exceptions

* Better tests
2018-10-09 19:51:29 +02:00
LemonBoy
f98a3056c6 Fix transformation of yield in inline context (#9135)
When the loop variables are part of the envP block it is not safe to use
a nkFastAsgn.

Fixes #2656
2018-10-09 19:43:31 +02:00
Dominik Picheta
21ecf64d24 Fixes #8994. FutureStream read procedure data loss no longer occurs. (#9183)
* Fixes #8994. FutureStream read procedure data loss no longer occurs.

* Optimises the fix for #8994.
2018-10-09 19:39:12 +02:00
Timothee Cour
a98b1a7764 fix #8341: add lastPathPart (#9116) 2018-10-09 19:27:31 +02:00
alaviss
2a31f42d35 asyncmacro: add nnkSym support for getName() (#9204)
Fixes #9201
2018-10-09 15:53:13 +02:00
LemonBoy
8a1055adce Fix range type construction in the VM (#9205)
The `range[X,Y]` representation is wrong, we use `range[X .. Y]`
instead.

Fixes #9194
2018-10-09 15:51:49 +02:00
alaviss
dad290accb os: use unlink() to remove file (#9220)
removeFile() behavior should now be consistant between Windows and POSIX

Fixes #9200
2018-10-09 15:37:36 +02:00
cooldome
036c52f0b6 fixes #9222 (#9224) 2018-10-09 15:19:21 +02:00
xzfc
505ae14f4b Codegen fix for procs taking type(nil) (#9231) 2018-10-09 14:51:34 +02:00
LemonBoy
b8d2f79ef0 Prevent the construction of recursive tyStatic types (#9256)
Fixes #9255
2018-10-09 14:26:34 +02:00