Commit Graph

4913 Commits

Author SHA1 Message Date
ee7
14c61ecf24 strictFuncs+views: add test that imports stdlib modules (#16878)
This commit attempts to improve testing of strictFuncs and views, and
prevent regressions like #16873 (resolved by 0b01eddace).

We previously only explicitly tested strictFuncs and views with a
smaller number of stdlib modules, mostly in:
- tests/effects/tstrict_funcs.nim
- tests/views/tcan_compile_nim.nim

Note that this commit leaves the `pegs` module commented out; it
cannot currently be compiled with `--experimental:views` (see #16892).

Note also that this commit is not sufficient to test strictFuncs and
views, but it does detect a subset of problems.
2021-02-03 16:00:29 +01:00
Timothee Cour
6f1289b80c remove .github/workflows/ci_ssl.yml; instead run via trunner_thirdparty (#16221) 2021-02-02 18:32:33 -08:00
konsumlamm
f4449a897d Sugar tests (#16820) 2021-02-02 18:11:59 -08:00
Clyybber
e4ad0ae5c4 Add testcase for #16897 (#16917) 2021-02-02 21:43:02 +01:00
Timothee Cour
7b9b76d840 tests/tuples/ttuples_issues.nim: test on all backends + various improvements (#16907)
* improve tests/tuples/ttuples_issues.nim: test on all backends

* address comments
2021-02-02 20:17:13 +01:00
Andreas Rumpf
fb80d2ff85 IC: bugfixes (WIP) (#16836)
* minor improvements
* IC: added the required logic for compilerProcs
* LazySym ftw
* we need this testing logic
* reimplement the old way we use for module package creation
* fixes a regression; don't pick module names if you can avoid it
2021-02-02 19:24:55 +01:00
Timothee Cour
4b2054a7bf dumpToString: improves on sugar.dump (#16841)
* dumpToString
* _
* fixup
* changelog
* address comment: removed the word "Deprecated"
2021-02-02 07:41:33 +01:00
konsumlamm
15d6be52a1 Improve doc comments (#16902)
Add runnableExamples
Use `reduce` in `initRational` and `//`
Add static tests
2021-02-02 07:04:30 +01:00
Timothee Cour
917f12ae52 2.5x- 3x faster copyFile on osx (#16883) 2021-02-01 17:38:17 -08:00
hlaaftana
def1f99289 add finally as post expr block [backport:1.4] (#16896) 2021-02-01 20:14:20 +01:00
flywind
de4f2604c2 fix #16822 (#16884)
* see whether it breaks

* fix #16884

* correct

* fix #14574
2021-02-01 13:31:04 +01:00
ee7
0b01eddace critbits: fix error from strictFuncs (#16877)
Previously, compiling a file containing just `import critbits` with
`nim c --experimental:strictFuncs` would produce the following error:
    critbits.nim(529, 6) Error: 'toCritBitTree' can have side effects

This was introduced by 2aed418698 (#16564).

Fixes: #16873
2021-02-01 13:14:23 +01:00
Timothee Cour
1a74576854 distinctBase now is identity instead of error for non distinct types (#16891) 2021-02-01 13:10:52 +01:00
konsumlamm
eef2948ec2 Fix #12595 (#16874) 2021-01-31 01:00:18 +01:00
flywind
296cf9657c add lost functions (#16843) 2021-01-29 15:14:19 +01:00
flywind
4e1e231e29 fix floats slice (#16853)
* see whether it breaks

* fix

* fix

* minor

* fix

* add enum

* use Ordinal types

* fix tests

* fix

* another style

* fix remainning cases
2021-01-29 12:26:36 +01:00
Timothee Cour
b0f38a63c4 fix #16815 round(x,places) works again in vm (#16825)
* fix #16815 round+places works again in vm

* improve tests; fix for linux 32bit

* fix test for windows
2021-01-28 10:40:18 +01:00
Timothee Cour
e112974920 fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750)
* osx now uses native TLS, which can be orders of magnitude faster

* add {.cppNonPod.}

* improve test

* changelog, docs, disable part of windows test
2021-01-27 22:35:43 +01:00
konsumlamm
3c8fddbc76 Improve documentation for the mersenne module (#16824)
* Improve documentation for mersenne

Add tests for mersenne

* Add link to Wikipedia article
2021-01-27 19:14:13 +00:00
Jason Beetham
ecc9704bf4 Moved json enum index test to the proper file (#16826) 2021-01-25 18:35:08 -08:00
Jason Beetham
dde096ffde added enum indexed array support to json (#16807)
* added enum indexed array support to json

* Added json test

* Removed when statement for enum indexed arrays
2021-01-26 00:55:49 +01:00
Clyybber
301e5838ec Finer analysis for array access (#16787)
* Refine the analysis for array access
* Cleanup
* Add comments
2021-01-24 21:01:41 +01:00
Timothee Cour
8f62cd512c fix manual to reflect reality for .nosideeffect (#16781) 2021-01-22 20:04:48 +01:00
konsumlamm
d2b218b80a Improve the marshal module (#16777)
* Improve marshal

Use runnableExamples
Refactor tests

* Readd {.inheritable.} test

Apply suggestions
2021-01-22 19:52:34 +01:00
Timothee Cour
18b983d7e3 addQuitProc => addExitProc (#16765) 2021-01-22 19:51:11 +01:00
Timothee Cour
8f1f0bd1da typetraits: make genericHead docs reflect reality; use runnableExamples (#16776) [backport:1.4] 2021-01-22 15:06:45 +01:00
Daehee
2d0cb18b9f Fix SIGSEGV in httpclient response body (#16766)
* initialize httpclient response bodyStream; prevent SIGSEGV when getBody is false

* Update lib/pure/httpclient.nim

* Update lib/pure/httpclient.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-01-22 15:04:52 +01:00
Clyybber
bebfbaa439 Add testcase for #14880 (#16795) 2021-01-22 13:14:28 +01:00
Juan Carlos
f1d165adf2 Testament small fixes (#16788)
* ReSync with Devel

* ReSync

* Fix Deprecations, Convertion to itself, code style, etc

* Fix Deprecations, Convertion to itself, code style, etc
2021-01-22 07:50:28 +01:00
Clyybber
3df652b90b Add testcase for #5993 (#16789) 2021-01-22 02:11:21 +01:00
flywind
dfe6797023 fix #15628 (#16387)
* done

* Apply suggestions from code review

* fixup

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-21 17:31:47 +01:00
Clyybber
57d5c1465a Part-to-whole optimization (#16775) 2021-01-21 15:25:00 +01:00
Timothee Cour
c17cad0992 close #8015: const array indexing zeroes data in object variants at runtime (#16782) 2021-01-21 11:11:42 +01:00
Timothee Cour
2b5841cd2b fix testament regression: installed testament works again with testament r path (#16767)
* fix testament regression: installed testament works again with testament r path

* fixup
2021-01-20 14:04:08 +01:00
Timothee Cour
14730d9d64 fix noDecl => nodecl (#16760)
* fix noDecl => nodecl

* address comment

* disable flaky tests/stdlib/thttpclient.nim on freebsd
2021-01-20 11:08:42 +01:00
Clyybber
ccb11a63fb Reboot of #16195 (#16746)
* fix #16185

* fix test

* fix comment

* fix comment

* better approach

* Add more tests and move sameLocation to injectdestructors

* Better and more strict sameLocation

* Small cleanup and preliminary spec clarification

* Fix

* Fix doc

* Expand test

Co-authored-by: Andrey R (cooldome) <ariabushenko@gmail.com>
2021-01-20 11:05:56 +01:00
Timothee Cour
4fc7fcb775 --hintAsError (#16763)
* --hintAsError

* add test, changelog

* condsyms
2021-01-20 10:49:59 +01:00
Timothee Cour
6c07b0a1f8 jsonutils.jsonTo: support opt (#16739) 2021-01-17 11:37:06 +01:00
Timothee Cour
18e14f5920 js: improve tests + some docs (#16727)
* js: improve tests

* _

* _

* _

* fixup
2021-01-16 12:08:40 +01:00
flywind
e4a529962e close #10735 add testcase (#16690) 2021-01-15 22:23:49 -08:00
Juan Carlos
78a99587a4 Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-01-15 18:56:38 -08:00
cooldome
fc9cf2088d Fix 16722 (#16730)
* fix #16722

* fix spacing

* spacing
2021-01-15 18:16:24 +00:00
Timothee Cour
52cf728001 followup for #16717: minimized example + improved comment (#16721) 2021-01-15 01:09:58 +01:00
Juan Carlos
41965880ce Add js BigInts (#16409)
* Add BigInts
* Renames tos plurals
* Improve Stringifications
* Update changelog.md

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

* RunnableExamplerize
* discard the discardable pragma
* Several improvements from peer reviews, more docs
* More doc, more test
* More doc, more test
* Better error message 'Error: usage of low is an {.error.} defined at jsbigints.nim' instead of just 'type mismatch JsBigInt'
* is an overload, rename
* proc to scare kids away
* Update lib/js/jsbigints.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* https://github.com/nim-lang/Nim/pull/16409#discussion_r554365041

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-14 20:19:41 +01:00
vabresto
a90f7a66ed Transfer-Encoding:chunked tests (#16678)
* Add tests and fix extra newlines in body

* Fixes per comments

* Slight rephrase per comments

* Improvements per comments

* Add getSocket to reduce test flakiness per comment

* Remove unused lines from header

* Add doc comment to getSocket per comment

* Apply witchcraft to replace `discard Future`

* Return HTTP 400 on bad encoding in request

* Fix runnable example for getSocket

* Fix import to fix runnable examples

* Even more imports for the example

* Better self documenting runnable example

* Add missing import

* Import from module with correct signature

* Resolve port type mismatch
2021-01-14 20:17:02 +01:00
flywind
ef9027c290 fix #16706 (#16717) [backport:1.4] 2021-01-14 16:52:00 +01:00
Timothee Cour
94430a2e6d enable tests/stdlib/thttpclient.nim (#16710)
* enable tests/stdlib/thttpclient.nim

* disable windows, openbsd
2021-01-14 11:10:02 +01:00
Timothee Cour
287dec06ae disable hint:processing in tests (#16713)
* disable hint:processing in tests

* fix test
2021-01-14 10:19:20 +01:00
Yuriy Glukhov
4ae520711d Fixes #16436 (#16695)
* Fixes #16436

* Comments addressed
2021-01-14 08:53:21 +01:00
Timothee Cour
fee5fbc722 fix #16703; revert most of #16480; add tests/stdlib/tmimetypes.nim (#16711) 2021-01-13 14:52:59 -08:00