summary refs log tree commit diff stats
path: root/compiler
Commit message (Expand)AuthorAgeFilesLines
...
* fixes #4519Andreas Rumpf2016-12-251-1/+1
* fixes #5142Araq2016-12-231-4/+6
* Merge branch 'devel' of github.com:nim-lang/Nim into develAraq2016-12-221-2/+2
|\
| * Used typed/untyped instead of stmt/expr in semQuoteAst. Fixes issue 5120 (#5126)Chris Heller2016-12-221-2/+2
* | fixes #5140Araq2016-12-221-1/+3
|/
* make tsets test green againAraq2016-12-221-5/+6
* fixes #5137Andreas Rumpf2016-12-221-14/+19
* implements module grouping for the import statementAndreas Rumpf2016-12-213-14/+26
* fixes recently introduced regressionAndreas Rumpf2016-12-211-6/+8
* fixes #5136Andreas Rumpf2016-12-211-6/+6
* fixes #5135Andreas Rumpf2016-12-211-0/+5
* fixes #5131Araq2016-12-201-1/+1
* make nimfix compile with newer compiler APIAraq2016-12-201-2/+3
* bugfix: aporia compiles againAraq2016-12-201-0/+1
* Merge branch 'devel' into sighashesAraq2016-12-197-17/+43
|\
| * make tests green againAraq2016-12-181-1/+1
| * Merge branch 'devel' of github.com:nim-lang/Nim into develAraq2016-12-181-2/+3
| |\
| | * fixes nimsuggest bug #43Andreas Rumpf2016-12-181-2/+3
| * | fixes #4308, fixes #4905Araq2016-12-183-1/+23
| * | debug output: show line info earlierAraq2016-12-181-1/+1
| |/
| * revert line info generation change; produces worse results for other casesAraq2016-12-181-2/+2
| * significantly better stack traces when templates are involvedAraq2016-12-181-8/+12
| * fixes nimsuggest issue #40Araq2016-12-181-1/+1
| * fixes nimsuggest issue #41Araq2016-12-181-1/+3
* | Merge branch 'devel' into sighashesAraq2016-12-176-10/+36
|\|
| * fixes #5129Araq2016-12-171-1/+3
| * Merge branch 'devel' of github.com:nim-lang/Nim into develAndreas Rumpf2016-12-175-51/+123
| |\
| | * Merge pull request #5124 from vegansk/fix_lib_outAndreas Rumpf2016-12-171-2/+8
| | |\
| | | * Use ``out`` compiler option when linking static libraryAnatoly Galiulin2016-12-161-2/+8
| | * | Gramma change: casted or Casted to cast or Cast respectivelyjlp7652016-12-172-4/+4
| | |/
| * | reworked emit pragma; fixes #4730Andreas Rumpf2016-12-172-3/+21
* | | Merge branch 'devel' into sighashesAraq2016-12-142-43/+105
|\ \ \ | | |/ | |/|
| * | Nim compiler generates nimcache/proj.json for easier interop with external bu...Araq2016-12-142-43/+104
* | | Merge branch 'devel' into sighashesAraq2016-12-131-4/+9
|\| |
| * | macros.getType: do not copy symbols if not necessaryAraq2016-12-071-4/+9
| |/
* | code cleanup and getting rid of debugging comments that nihilated the sighash...Araq2016-12-131-14/+3
* | sighashes: multi-methods should work nowAndreas Rumpf2016-12-131-0/+2
* | sighashes: do not use the ID mechanism at allAraq2016-12-133-11/+56
* | make tsigbreak.nim compileAndreas Rumpf2016-12-124-7/+14
* | fixes serious codegen regression that caused Nimble to misbehaveAraq2016-12-101-1/+1
* | store typeinfo also in local hash table to prevent multiple 'extern' declarat...Araq2016-12-101-0/+4
* | make the Nim compiler compile as C++Araq2016-12-101-2/+4
* | don't use sfExported for sig hashingAraq2016-1
function test_resize_window()
  io.write('\ntest_resize_window')
  App.screen.init{width=300, height=300}
  Editor_state = edit.initialize_test_state()
  Editor_state.filename = 'foo'
  Log_browser_state = edit.initialize_test_state()
  check_eq(App.screen.width, 300, 'F - test_resize_window/baseline/width')
  check_eq(App.screen.height, 300, 'F - test_resize_window/baseline/height')
  check_eq(Editor_state.left, Test_margin_left, 'F - test_resize_window/baseline/left_margin')
  App.resize(200, 400)
  check_eq(App.screen.width, 200, 'F - test_resize_window/width')
  check_eq(App.screen.height, 400, 'F - test_resize_window/height')
  check_eq(Editor_state.left, Test_margin_left, 'F - test_resize_window/left_margin')
  -- ugly; right margin switches from 0 after resize
  check_eq(Editor_state.right, 200-Margin_right, 'F - test_resize_window/right_margin')
  check_eq(Editor_state.width, 200-Test_margin_left-Margin_right, 'F - test_resize_window/drawing_width')
  -- TODO: how to make assertions about when App.update got past the early exit?
end

function test_drop_file()
  io.write('\ntest_drop_file')
  App.screen.init{width=Editor_state.left+300, height=300}
  Editor_state = edit.initialize_test_state()
  App.filesystem['foo'] = 'abc\ndef\nghi\n'
  local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
                    return 'foo'
                  end,
    open = function(self)
             self.opened = true
           end,
    lines = function(self)
              assert(self.opened)
              return App.filesystem['foo']:gmatch('[^\n]+')
            end,
    close = function(self)
              self.opened = false
            end,
  }
  App.filedropped(fake_dropped_file)
  check_eq(#Editor_state.lines, 3, 'F - test_drop_file/#lines')
  check_eq(Editor_state.lines[1].data, 'abc', 'F - test_drop_file/lines:1')
  check_eq(Editor_state.lines[2].data, 'def', 'F - test_drop_file/lines:2')
  check_eq(Editor_state.lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
  edit.draw(Editor_state)
end

function test_drop_file_saves_previous()
  io.write('\ntest_drop_file_saves_previous')
  App.screen.init{width=Editor_state.left+300, height=300}
  -- initially editing a file called foo that hasn't been saved to filesystem yet
  Editor_state.lines = load_array{'abc', 'def'}
  Editor_state.filename = 'foo'
  schedule_save(Editor_state)
  -- now drag a new file bar from the filesystem
  App.filesystem['bar'] = 'abc\ndef\nghi\n'
  local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
                    return 'bar'
                  end,
    open = function(self)
             self.opened = true
           end,
    lines = function(self)
              assert(self.opened)
              return App.filesystem['bar']:gmatch('[^\n]+')
            end,
    close = function(self)
              self.opened = false
            end,
  }
  App.filedropped(fake_dropped_file)
  -- filesystem now contains a file called foo
  check_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')
end