summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Sugar tests (#16820)konsumlamm2021-02-021-118/+215
|
* Add testcase for #16897 (#16917)Clyybber2021-02-021-0/+33
|
* tests/tuples/ttuples_issues.nim: test on all backends + various improvements ↵Timothee Cour2021-02-023-110/+123
| | | | | | | (#16907) * improve tests/tuples/ttuples_issues.nim: test on all backends * address comments
* IC: bugfixes (WIP) (#16836)Andreas Rumpf2021-02-021-0/+29
| | | | | | | | * 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
* `dumpToString`: improves on `sugar.dump` (#16841)Timothee Cour2021-02-021-1/+11
| | | | | | | * dumpToString * _ * fixup * changelog * address comment: removed the word "Deprecated"
* Improve doc comments (#16902)konsumlamm2021-02-021-83/+85
| | | | | Add runnableExamples Use `reduce` in `initRational` and `//` Add static tests
* 2.5x- 3x faster copyFile on osx (#16883)Timothee Cour2021-02-011-9/+14
|
* add finally as post expr block [backport:1.4] (#16896)hlaaftana2021-02-011-0/+115
|
* fix #16822 (#16884)flywind2021-02-012-2/+30
| | | | | | | | | * see whether it breaks * fix #16884 * correct * fix #14574
* critbits: fix error from strictFuncs (#16877)ee72021-02-011-0/+1
| | | | | | | | | 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 2aed4186989e (#16564). Fixes: #16873
* distinctBase now is identity instead of error for non distinct types (#16891)Timothee Cour2021-02-011-0/+2
|
* Fix #12595 (#16874)konsumlamm2021-01-311-2/+8
|
* add lost functions (#16843)flywind2021-01-291-0/+2
|
* fix floats slice (#16853)flywind2021-01-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * see whether it breaks * fix * fix * minor * fix * add enum * use Ordinal types * fix tests * fix * another style * fix remainning cases
* fix #16815 round(x,places) works again in vm (#16825)Timothee Cour2021-01-281-28/+30
| | | | | | | * fix #16815 round+places works again in vm * improve tests; fix for linux 32bit * fix test for windows
* fix #16752: threadvar now works with importcpp types; osx now uses native ↵Timothee Cour2021-01-274-0/+147
| | | | | | | | | | | 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
* Improve documentation for the mersenne module (#16824)konsumlamm2021-01-271-0/+11
| | | | | | | * Improve documentation for mersenne Add tests for mersenne * Add link to Wikipedia article
* Moved json enum index test to the proper file (#16826)Jason Beetham2021-01-252-11/+12
|
* added enum indexed array support to json (#16807)Jason Beetham2021-01-261-0/+11
| | | | | | | * added enum indexed array support to json * Added json test * Removed when statement for enum indexed arrays
* Finer analysis for array access (#16787)Clyybber2021-01-241-0/+31
| | | | | * Refine the analysis for array access * Cleanup * Add comments
* fix manual to reflect reality for .nosideeffect (#16781)Timothee Cour2021-01-221-0/+24
|
* Improve the marshal module (#16777)konsumlamm2021-01-221-94/+85
| | | | | | | | | | * Improve marshal Use runnableExamples Refactor tests * Readd {.inheritable.} test Apply suggestions
* addQuitProc => addExitProc (#16765)Timothee Cour2021-01-223-3/+11
|
* typetraits: make genericHead docs reflect reality; use runnableExamples ↵Timothee Cour2021-01-221-1/+6
| | | | (#16776) [backport:1.4]
* Fix SIGSEGV in httpclient response body (#16766)Daehee2021-01-221-0/+6
| | | | | | | | | * 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>
* Add testcase for #14880 (#16795)Clyybber2021-01-221-0/+10
|
* Testament small fixes (#16788)Juan Carlos2021-01-221-28/+0
| | | | | | | | | * ReSync with Devel * ReSync * Fix Deprecations, Convertion to itself, code style, etc * Fix Deprecations, Convertion to itself, code style, etc
* Add testcase for #5993 (#16789)Clyybber2021-01-221-0/+16
|
* fix #15628 (#16387)flywind2021-01-212-25/+36
| | | | | | | | | * done * Apply suggestions from code review * fixup Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* Part-to-whole optimization (#16775)Clyybber2021-01-211-1/+46
|
* close #8015: const array indexing zeroes data in object variants at runtime ↵Timothee Cour2021-01-211-0/+57
| | | | (#16782)
* fix testament regression: installed testament works again with testament r ↵Timothee Cour2021-01-201-0/+9
| | | | | | | path (#16767) * fix testament regression: installed testament works again with testament r path * fixup
* fix noDecl => nodecl (#16760)Timothee Cour2021-01-202-1/+2
| | | | | | | * fix noDecl => nodecl * address comment * disable flaky tests/stdlib/thttpclient.nim on freebsd
* Reboot of #16195 (#16746)Clyybber2021-01-202-1/+159
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* `--hintAsError` (#16763)Timothee Cour2021-01-201-0/+35
| | | | | | | * --hintAsError * add test, changelog * condsyms
* jsonutils.jsonTo: support opt (#16739)Timothee Cour2021-01-171-0/+3
|
* js: improve tests + some docs (#16727)Timothee Cour2021-01-163-262/+173
| | | | | | | | | | | * js: improve tests * _ * _ * _ * fixup
* close #10735 add testcase (#16690)flywind2021-01-151-0/+41
|
* Deprecate TaintedString (#15423)Juan Carlos2021-01-157-17/+17
| | | | Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Fix 16722 (#16730)cooldome2021-01-151-1/+43
| | | | | | | * fix #16722 * fix spacing * spacing
* followup for #16717: minimized example + improved comment (#16721)Timothee Cour2021-01-151-32/+44
|
* Add js BigInts (#16409)Juan Carlos2021-01-141-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Transfer-Encoding:chunked tests (#16678)vabresto2021-01-141-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* fix #16706 (#16717) [backport:1.4]flywind2021-01-141-0/+37
|
* enable tests/stdlib/thttpclient.nim (#16710)Timothee Cour2021-01-141-5/+6
| | | | | * enable tests/stdlib/thttpclient.nim * disable windows, openbsd
* disable hint:processing in tests (#16713)Timothee Cour2021-01-142-0/+4
| | | | | * disable hint:processing in tests * fix test
* Fixes #16436 (#16695)Yuriy Glukhov2021-01-141-0/+23
| | | | | * Fixes #16436 * Comments addressed
* fix #16703; revert most of #16480; add tests/stdlib/tmimetypes.nim (#16711)Timothee Cour2021-01-131-0/+13
|
* revive PR #16320 (CRLF fix); fix #16308; Update openssl.nim (#16648)Timothee Cour2021-01-121-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update openssl.nim Fix issue # 16308 * Update openssl.nim These are also related to Issues [#16308](https://github.com/nim-lang/Nim/issues/16308) * Update openssl.nim * Add files via upload SSL PEM_read_RSAPUBKEY check * Delete topenssl_rsa_private_key.pem * Delete topenssl_rsa_public_key.pem * Delete topenssl.nim * Add files via upload * Update topenssl.nim This test makes me dizzy. Variables such as' PRSA 'must be declared in advance, otherwise they will run incorrectly. The argument uses a cString, and string also makes an error. * Update topenssl.nim ``` lhf@lhf-pc:/media/lhf/D$ cat -e ./topenssl.nim import std/wordwrap$ import openssl$ ``` * Update topenssl.nim * dos2unix tests/stdlib/topenssl.nim Co-authored-by: lihaifeng <lihaifeng@wxm.com>
* Improve uri.parseQuery to never raise an error (#16647)Mildred Ki'Lya2021-01-121-2/+1
| | | | | | | | | | | | | | | | | In case of malformed query string where there is `=` on the value, handle this character as part of the value instead of throwing an error. The following query string should no longer crash a program: key=value&key2=x=1 It will be interpreted as [("key", "value"), ("key2", "x=1")] This is correct according to latest WhatWG's HTML5 specification recarding the urlencoded parser: https://url.spec.whatwg.org/#concept-urlencoded-parser Older behavior can be restored using the -d:nimLegacyParseQueryStrict flag.
class="o">= -(*c->w / 2) + c->border; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: dx = -(*c->w + c->border); break; default: break; } if(invert) { dx = -dx; dy = -dy; } *c->x += dx; *c->y += dy; } void higher(Client *c) { XRaiseWindow(dpy, c->win); XRaiseWindow(dpy, c->title); } void killclient(Arg *arg) { if(!sel) return; if(sel->proto & WM_PROTOCOL_DELWIN) sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); else XKillClient(dpy, sel->win); } void lower(Client *c) { XLowerWindow(dpy, c->title); XLowerWindow(dpy, c->win); } void manage(Window w, XWindowAttributes *wa) { Client *c; XSetWindowAttributes twa; Window trans; c = emallocz(sizeof(Client)); c->win = w; c->bx = c->fx = c->tx = wa->x; c->by = c->fy = c->ty = wa->y; if(c->fy < bh) c->by = c->fy = c->ty += bh; c->bw = c->fw = c->tw = wa->width; c->fh = c->th = wa->height; c->bh = bh; c->border = 1; c->proto = getproto(c->win); setsize(c); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans); twa.override_redirect = 1; twa.background_pixmap = ParentRelative; twa.event_mask = ExposureMask; c->title = XCreateWindow(dpy, root, c->bx, c->by, c->bw, c->bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); settags(c); c->next = clients; clients = c; XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button1, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); if(!c->isfloat) c->isfloat = trans || ((c->maxw == c->minw) && (c->maxh == c->minh)); setgeom(c); settitle(c); arrange(NULL); /* mapping the window now prevents flicker */ if(c->tags[tsel]) { XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); focus(c); } else { ban(c); XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); XSync(dpy, False); } } void maximize(Arg *arg) { if(!sel) return; *sel->x = sx; *sel->y = sy + bh; *sel->w = sw - 2 * sel->border; *sel->h = sh - 2 * sel->border - bh; higher(sel); resize(sel, False); } void pop(Client *c) { Client **l; for(l = &clients; *l && *l != c; l = &(*l)->next); *l = c->next; c->next = clients; /* pop */ clients = c; arrange(NULL); } void resize(Client *c, Bool inc) { XConfigureEvent e; if(inc) { if(c->incw) *c->w -= (*c->w - c->basew) % c->incw; if(c->inch) *c->h -= (*c->h - c->baseh) % c->inch; } if(*c->x > sw) /* might happen on restart */ *c->x = sw - *c->w; if(*c->y > sh) *c->y = sh - *c->h; if(c->minw && *c->w < c->minw) *c->w = c->minw; if(c->minh && *c->h < c->minh) *c->h = c->minh; if(c->maxw && *c->w > c->maxw) *c->w = c->maxw; if(c->maxh && *c->h > c->maxh) *c->h = c->maxh; resizetitle(c); XSetWindowBorderWidth(dpy, c->win, 1); XMoveResizeWindow(dpy, c->win, *c->x, *c->y, *c->w, *c->h); e.type = ConfigureNotify; e.event = c->win; e.window = c->win; e.x = *c->x; e.y = *c->y; e.width = *c->w; e.height = *c->h; e.border_width = c->border; e.above = None; e.override_redirect = False; XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e); XSync(dpy, False); } void setgeom(Client *c) { if((arrange == dotile) && !c->isfloat) { c->x = &c->tx; c->y = &c->ty; c->w = &c->tw; c->h = &c->th; } else { c->x = &c->fx; c->y = &c->fy; c->w = &c->fw; c->h = &c->fh; } } void setsize(Client *c) { XSizeHints size; long msize; if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) size.flags = PSize; c->flags = size.flags; if(c->flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height; } else c->basew = c->baseh = 0; if(c->flags & PResizeInc) { c->incw = size.width_inc; c->inch = size.height_inc; } else c->incw = c->inch = 0; if(c->flags & PMaxSize) { c->maxw = size.max_width; c->maxh = size.max_height; } else c->maxw = c->maxh = 0; if(c->flags & PMinSize) { c->minw = size.min_width; c->minh = size.min_height; } else c->minw = c->minh = 0; if(c->flags & PWinGravity) c->grav = size.win_gravity; else c->grav = NorthWestGravity; } void settitle(Client *c) { XTextProperty name; int n; char **list = NULL; name.nitems = 0; c->name[0] = 0; XGetTextProperty(dpy, c->win, &name, netatom[NetWMName]); if(!name.nitems) XGetWMName(dpy, c->win, &name); if(!name.nitems) return; if(name.encoding == XA_STRING) strncpy(c->name, (char *)name.value, sizeof(c->name)); else { if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { strncpy(c->name, *list, sizeof(c->name)); XFreeStringList(list); } } XFree(name.value); resizetitle(c); } void unmanage(Client *c) { Client **l; XGrabServer(dpy); XSetErrorHandler(xerrordummy); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->title); for(l = &clients; *l && *l != c; l = &(*l)->next); *l = c->next; for(l = &clients; *l; l = &(*l)->next) if((*l)->revert == c) (*l)->revert = NULL; if(sel == c) sel = sel->revert ? sel->revert : clients; free(c); XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); arrange(NULL); if(sel) focus(sel); } void zoom(Arg *arg) { Client *c; if(!sel) return; if(sel == getnext(clients, tsel) && sel->next) { if((c = getnext(sel->next, tsel))) sel = c; } pop(sel); focus(sel); }