diff options
author | Michael Reed <Pyrohh@users.noreply.github.com> | 2015-07-06 04:07:23 -0400 |
---|---|---|
committer | Michael Reed <Pyrohh@users.noreply.github.com> | 2015-07-06 04:07:23 -0400 |
commit | 1b78ad1c4d1533fe3089b9744a5306616e562f3e (patch) | |
tree | 19a6e6c0de104ad0d88031e7d255c0c05d3da080 /test/functional/legacy/061_undo_tree_spec.lua | |
parent | deab194413af1475f8f4d8657500c1250521059e (diff) | |
parent | 8f4e3a68a88a7c98afa3ff8c53e98d7ceb32fc15 (diff) | |
download | rneovim-1b78ad1c4d1533fe3089b9744a5306616e562f3e.tar.gz rneovim-1b78ad1c4d1533fe3089b9744a5306616e562f3e.tar.bz2 rneovim-1b78ad1c4d1533fe3089b9744a5306616e562f3e.zip |
Merge pull request #2932 from lucc/helpers/write_file
[RDY] tests: Add write_file helper function
Reviewed-by: Florian Walch <florian@fwalch.com>
Reviewed-by: Michael Reed <m.reed@mykolab.com>
Diffstat (limited to 'test/functional/legacy/061_undo_tree_spec.lua')
-rw-r--r-- | test/functional/legacy/061_undo_tree_spec.lua | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/functional/legacy/061_undo_tree_spec.lua b/test/functional/legacy/061_undo_tree_spec.lua index c911e2be47..8cc2a371bb 100644 --- a/test/functional/legacy/061_undo_tree_spec.lua +++ b/test/functional/legacy/061_undo_tree_spec.lua @@ -1,9 +1,10 @@ -- Tests for undo tree and :earlier and :later. local helpers = require('test.functional.helpers') -local feed, insert, source, eq, eval, clear, execute, expect, wait = - helpers.feed, helpers.insert, helpers.source, helpers.eq, helpers.eval, - helpers.clear, helpers.execute, helpers.expect, helpers.wait +local feed, insert, source, eq, eval, clear, execute, expect, wait, write_file + = helpers.feed, helpers.insert, helpers.source, helpers.eq, helpers.eval, + helpers.clear, helpers.execute, helpers.expect, helpers.wait, + helpers.write_file local function expect_empty_buffer() -- The space will be removed by helpers.dedent but is needed because dedent @@ -13,12 +14,6 @@ end local function expect_line(line) return eq(line, eval('getline(".")')) end -local function write_file(name, text) - local file = io.open(name, 'w') - file:write(text) - file:flush() - file:close() -end describe('undo tree:', function() before_each(clear) @@ -40,7 +35,7 @@ describe('undo tree:', function() write_file('Xtest', '\n123456789\n') -- `:earlier` and `:later` are (obviously) time-sensitive, so this test - -- sometimes fails if the system is under load. It is wrapped in a local + -- sometimes fails if the system is under load. It is wrapped in a local -- function to allow multiple attempts. local function test_earlier_later() clear() |