summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* fixes {.global.} ref typedesc regressions (#22046)ringabout2023-06-081-5/+7
|
* Nested `with` blocks (#22042)awr12023-06-081-0/+16
| | | | | * Implemented with-nesting in underscoredCalls() * Add tests for nested with
* fixes overriden typo (#22044)ringabout2023-06-081-2/+2
|
* fixes #21995: align C++ with C backend behavior for empty raise state… ↵heterodoxic2023-06-071-0/+9
| | | | | | | (#21998) * fixes #21995: align C with C++ backend behavior for empty raise statements * make runtime behavior match across both C and C++ backend and all exception modes
* retain forced open undeclared ident information (#22019)metagn2023-06-071-0/+17
|
* add test case to close #7974 (#22023)metagn2023-06-061-0/+55
| | | close #7974 by adding test case
* close #12852; add a test case (#22016)ringabout2023-06-061-0/+55
|
* some test cleanups & category reorganization (#22010)metagn2023-06-06132-371/+186
| | | | | | | | | | | | | | | | | * clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
* post expr blocks colon fix + correct grammar (#21983)metagn2023-06-061-0/+8
| | | | | | | | | | | | | | | * post expr blocks colon fix + correct grammar fixes #21982 * fix dochelpers * this is remarkably common * use head for unchained * fix atlas * final grammar fix
* properly disallow unresolved generic proc values (#22005)metagn2023-06-051-8/+2
| | | | | | | * properly disallow unresolved generic proc values * mirrors semoperand * shallow efTypeAllowed, add back special case
* add test case for #7839 (#22006)Bung2023-06-051-0/+9
|
* infer error for `=dup` if there is a custom `=copy` error hook (#22004)ringabout2023-06-051-2/+2
|
* shallow fix for #21972, #18552 by moving std::exception_ptr to the parent ↵heterodoxic2023-06-041-0/+33
| | | | | sco… (#21988) shallow fix for #21972 by moving std::exception_ptr to the parent scope, minor cleanup
* fixes #21987; don't create type bound ops for anything in a function with a ↵ringabout2023-06-041-0/+48
| | | | | | | `nodestroy` pragma (#21992) * fixes #21987; don't create type bound ops for anything in a function with a `nodestroy` pragma * add a comment
* lift the `=dup` hook (#21903)ringabout2023-06-028-33/+35
| | | | | | * fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
* partially fixes #20787 by having a char dummy member prepended to objs only ↵heterodoxic2023-06-011-0/+4
| | | | | containing an UncheckedArray (i.e. C FAM) (#21979) partial fix for #20787
* fixes #21974; fixes sameConstant fieldDefect (#21981)ringabout2023-06-011-0/+30
| | | | | * fixes #21974; fixes sameConstant fieldDefect * add a test case
* Implements: [C++] constructor pragma improvement (fix #21921) (#21916)Juan M Gómez2023-05-301-2/+33
| | | | | | | | | | | | | | | * implements: [C++] constructor pragma improvement (fix #21921) t * fix test so it doesnt use echo in globals * Update compiler/ccgtypes.nim * Update lib/std/private/dragonbox.nim --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* make `proc` not implicitly convert to `pointer` with a preview define (#21953)metagn2023-05-304-9/+10
| | | | | | | | | * test `proc` not converting to `pointer` * ignore define for now to test * remove cstring * fixes, changelog
* alternative to #21914; split, rsplit now forbid an empty separator (#21961)ringabout2023-05-301-0/+14
|
* Add anti-regression for #21958 (#21960)Mamy Ratsimbazafy2023-05-301-0/+11
| | | Add anti-regression test to close #21958
* fixes fieldDefect loses enum type info in ORC; consistent with VM and refc ↵ringabout2023-05-291-2/+1
| | | | | (#21954) fixes fieldDefect loses enum type info in ORC
* support generic void return type for templates (#21934)metagn2023-05-271-0/+6
| | | fixes #21920
* fixes #15428 by updating deep open array copy codegen (#21935)heterodoxic2023-05-271-0/+22
| | | | | * fix #15428 * add test
* fix #10964 by honoring pointer deref syntax if a reified openarray is used ↵heterodoxic2023-05-271-0/+6
| | | | | | | to get an array's length (#21925) * fix #10964 * add test
* fix & add test for basic hot code reloading case (#21915)metagn2023-05-261-0/+7
| | | fixes #21885
* fixes #21887; Type conversion on overloaded enum field does not always call ↵ringabout2023-05-261-0/+8
| | | | | | | | | | | (#21908) * fixes #21887; Type conversion on overloaded enum field does not always call * remove comments * add a test case * restrict it to enums
* Fix const in async regression (#21898)Jake Leahy2023-05-251-0/+13
| | | | | | | | | * Add test case for a const being used inside an async proc * Use `typeof` to get the type of the block instead of overloaded templates This removes the problem with the symbol having different types I am unsure why I didn't use this in the first place. IIRC I had problems with `typeof` when I first tried to use it in the original implementation
* when T is both a type symbol and a routine symbol in scope of a generic proc ↵metagn2023-05-242-0/+9
| | | | | do not account for the type symbol when doing `a.T()` (#21899) fix #21883
* actually fixes #21889 "constructor pragma doing nothing in globals" (#21897)Juan M Gómez2023-05-241-0/+24
| | | actually fixes #21889
* fix #21896 asign parameter to global variable generates invalid code (#21900)Bung2023-05-241-0/+9
|
* fixes #21863; Incorrect enum field access can cause internal error (#21886)ringabout2023-05-241-0/+28
| | | fixes 21863; Incorrect enum field access can cause internal error
* fix #21251 Compiler SIGSEGV when using SharedTable (#21876)Bung2023-05-231-0/+6
| | | fix #21251
* Weekday parse/format (replacement) (#21857)Carlo Capocasa2023-05-212-49/+24
| | | | | * parsing capability for iso week year * remove outdated test
* Fixed generic parameters failing to be used in inheritance (#21866)Jason Beetham2023-05-211-0/+39
|
* implements allow byref to work in params #21873 (#21875)Juan M Gómez2023-05-211-5/+14
|
* fix #14254 (#21837)metagn2023-05-202-0/+6
| | | | | | | * fix #14254 * use temporary PR branch for neo * fix url
* Cpp Vfunctions draft (#21790)Juan M Gómez2023-05-171-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * introduces virtual pragma, modifies proc def, prevents proc decl * marks virtual procs as infix * forward declare vfuncs inside the typedef * adds naked callConv to virtual * virtual proc error if not defined in the same top level scope as the type * first param is now this. extracts genvirtualheaderproc * WIP syntax * supports obj. Removes the need for the prefix * parameter count starts as this. Cleanup * clean up * sem tests * adds integration tests * uses constraint to store the virtual content * introduces genVirtualProcParams --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* tasks that support return values (#21859)Andreas Rumpf2023-05-171-0/+18
| | | tasks.nim: Code cleanups and support expressions that produce a value
* fixes #21847; let `parseFloat` behave like `strtod` (#21854)ringabout2023-05-171-2/+8
|
* fixes #21708; skip colons for tuples in VM (#21850)ringabout2023-05-171-0/+10
| | | | | | | * fixes #21708; skip colon for tuples in VM * skip nimnodes * fixes types
* close #19990; adds a test case (#21853)ringabout2023-05-151-0/+14
|
* isolation spec update; WIP (#21843)Andreas Rumpf2023-05-141-0/+67
| | | | | | | | | | | * isolation spec update; WIP * wip * docs update, WIP * progress * Update doc/manual.md
* closes #7590; add a test case (#21846)ringabout2023-05-141-0/+20
|
* fixes #21840; nested local template lookup regression (#21841)ringabout2023-05-121-0/+74
| | | | | | | * fixes #21840; nested local template lookup regression * use original types * fixes js vm tests
* make deprecated statement a no-op (#21836)metagn2023-05-121-1/+1
|
* Add `minmax` to comparisons (#21820)Matt Wilson2023-05-121-0/+8
| | | | | | | | | | | | | | * Add `minmax` to sequtils This adds a `minmax` proc to complement `min` and `max`; it computes both results in a single pass for efficiency. * Update lib/pure/collections/sequtils.nim * Add minmax note to changelog. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* cursor fields cannot form reference cycles (#21832)ringabout2023-05-111-4/+16
| | | | | | | * cursor fields cannot form a reference cycle * fixes typo * fixes position
* adds documentation for `=wasMoved` and `=dup` hooks and small fixes (#21827)ringabout2023-05-111-1/+1
| | | | | | | | | | | * adds documentation for `=wasMoved` and `=dup` hooks and small fixes * Update doc/destructors.md * Update doc/destructors.md --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* bring #21802 back; fixes #21753 [backport] (#21815)ringabout2023-05-111-0/+123
| | | | | | | | | | | | | * bring #21802 back; fixes #21753 [backport] * adds tests and multiple fixes * add test cases * refactor and remove startId * fixes custom hooks and adds tests * handle tyUncheckedArray better
return NULL; } void gravitate(Client *c, Bool invert) { int dx = 0, dy = 0; switch(c->grav) { default: break; case StaticGravity: case NorthWestGravity: case NorthGravity: case NorthEastGravity: dy = c->border; break; case EastGravity: case CenterGravity: case WestGravity: dy = -(c->h / 2) + c->border; break; case SouthEastGravity: case SouthGravity: case SouthWestGravity: dy = -(c->h); break; } switch (c->grav) { default: break; case StaticGravity: case NorthWestGravity: case WestGravity: case SouthWestGravity: dx = c->border; break; case NorthGravity: case CenterGravity: case SouthGravity: dx = -(c->w / 2) + c->border; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: dx = -(c->w + c->border); 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 & PROTODELWIN) 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; Window trans; XSetWindowAttributes twa; c = emallocz(sizeof(Client)); c->tags = emallocz(ntags * sizeof(Bool)); c->win = w; c->x = c->tx = wa->x; c->y = c->ty = wa->y; c->w = c->tw = wa->width; c->h = wa->height; c->th = bh; c->border = 0; setsize(c); if(c->h != sh && c->y < bh) c->y = c->ty = bh; c->proto = getproto(c->win); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans); twa.override_redirect = 1; twa.background_pixmap = ParentRelative; twa.event_mask = ExposureMask | EnterWindowMask; c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); if(clients) clients->prev = c; c->next = clients; clients = c; XGrabButton(dpy, Button1, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, MODKEY, c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); settags(c); if(!c->isfloat) c->isfloat = trans || (c->maxw && c->minw && c->maxw == c->minw && c->maxh == c->minh); settitle(c); arrange(NULL); /* mapping the window now prevents flicker */ XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); if(c->tags[tsel]) focus(c); } void resize(Client *c, Bool sizehints, Corner sticky) { int bottom = c->y + c->h; int right = c->x + c->w; /*XConfigureEvent e;*/ XWindowChanges wc; if(sizehints) { if(c->incw) c->w -= (c->w - c->basew) % c->incw; if(c->inch) c->h -= (c->h - c->baseh) % c->inch; 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; } if(c->x > right) /* might happen on restart */ c->x = right - c->w; if(c->y > bottom) c->y = bottom - c->h; if(sticky == TopRight || sticky == BotRight) c->x = right - c->w; if(sticky == BotLeft || sticky == BotRight) c->y = bottom - c->h; resizetitle(c); wc.x = c->x; wc.y = c->y; wc.width = c->w; wc.height = c->h; if(c->w == sw && c->h == sh) wc.border_width = 0; else wc.border_width = 1; XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); XSync(dpy, False); } void setsize(Client *c) { long msize; XSizeHints size; 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) { char **list = NULL; int n; XTextProperty name; 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 togglemax(Arg *arg) { int ox, oy, ow, oh; XEvent ev; if(!sel) return; if((sel->ismax = !sel->ismax)) { ox = sel->x; oy = sel->y; ow = sel->w; oh = sel->h; sel->x = sx; sel->y = sy + bh; sel->w = sw - 2; sel->h = sh - 2 - bh; higher(sel); resize(sel, False, TopLeft); sel->x = ox; sel->y = oy; sel->w = ow; sel->h = oh; } else resize(sel, False, TopLeft); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } void unmanage(Client *c) { XGrabServer(dpy); XSetErrorHandler(xerrordummy); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->title); if(c->prev) c->prev->next = c->next; if(c->next) c->next->prev = c->prev; if(c == clients) clients = c->next; if(sel == c) { sel = getnext(c->next); if(!sel) sel = getprev(c->prev); if(!sel) sel = clients; } free(c->tags); 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) && sel->next) { if((c = getnext(sel->next))) sel = c; } /* pop */ if(sel->prev) sel->prev->next = sel->next; if(sel->next) sel->next->prev = sel->prev; sel->prev = NULL; if(clients) clients->prev = sel; sel->next = clients; clients = sel; arrange(NULL); focus(sel); }