summary refs log tree commit diff stats
path: root/tests/cpp/t4834.nim
blob: 0275b1b70dcabb4282c81a7893ac504e3bf7f08e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  targets: "cpp"
"""

# issue #4834
block:
  defer:
    let x = 0


proc main() =
  block:
    defer:
      raise newException(Exception, "foo")

doAssertRaises(Exception):
  main()
.stdscr():addstr(s) end function M.mvaddstr (y, x, s) return curses.stdscr():mvaddstr(y, x, s) end function M.attrset (a) return curses.stdscr():attrset(a) end function M.clear () return curses.stdscr():clear() end function M.clrtobot () return curses.stdscr():clrtobot() end function M.clrtoeol () return curses.stdscr():clrtoeol() end function M.getch () return curses.stdscr():getch() end function M.mvgetch (y, x) return curses.stdscr():getch(y, x) end function M.getstr (s) return curses.stdscr():getstr(s) end function M.mvgetstr (y, x, s) return curses.stdscr():mvgetstr(y, x, s) end function M.getyx () return curses.stdscr():getyx() end function M.keypad (b) return curses.stdscr():keypad(b) end function M.move (y,x) return curses.stdscr():move(y,x) end function M.refresh () return curses.stdscr():refresh() end function M.timeout (t) return curses.stdscr():timeout(t) end return M