From 549fc9548deaa737ff101806b60cedd7d4970c28 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Wed, 1 Oct 2014 09:05:28 -0300 Subject: test: Move 'test/legacy' to 'test/functional' Busted can only discover tests from a single directory. In order to allow tests under 'legacy' to run as a functional test, it needed to be moved to 'test/functional'. --- cmake/RunTests.cmake | 2 +- .../legacy/002_filename_recognition_spec.lua | 42 ++++++++++++++++++++++ test/legacy/002_filename_recognition_spec.lua | 42 ---------------------- 3 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 test/functional/legacy/002_filename_recognition_spec.lua delete mode 100644 test/legacy/002_filename_recognition_spec.lua diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index dc02ce5400..b89957bb28 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -7,7 +7,7 @@ endif() if(TEST_TYPE STREQUAL "functional") execute_process( COMMAND python ${BUSTED_PRG} ${BUSTED_REAL_PRG} -v -o - ${BUSTED_OUTPUT_TYPE} --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/legacy + ${BUSTED_OUTPUT_TYPE} --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/functional WORKING_DIRECTORY ${WORKING_DIR} RESULT_VARIABLE res) else() diff --git a/test/functional/legacy/002_filename_recognition_spec.lua b/test/functional/legacy/002_filename_recognition_spec.lua new file mode 100644 index 0000000000..569e748631 --- /dev/null +++ b/test/functional/legacy/002_filename_recognition_spec.lua @@ -0,0 +1,42 @@ +-- Test if URLs are recognized as filenames by commands such as "gf". Here +-- we'll use `expand("")` since "gf" would need to open the file. + +local helpers = require('test.functional.helpers') +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local execute, expect = helpers.execute, helpers.expect + +describe('filename recognition', function() + setup(clear) + + it('is working', function() + -- insert some lines containing URLs + insert([[ + first test for URL://machine.name/tmp/vimtest2a and other text + second test for URL://machine.name/tmp/vimtest2b. And other text + third test for URL:\\machine.name\vimtest2c and other text + fourth test for URL:\\machine.name\tmp\vimtest2d, and other text]]) + + -- Go to the first URL and append it to the beginning + execute('/^first', '/tmp', 'call append(0, expand(""))') + + -- Repeat for the second URL + -- this time, navigate to the word "URL" instead of "tmp" + execute('/^second', '/URL', 'call append(1, expand(""))') + + -- Repeat for the remaining URLs. This time, the 'isfname' option must be + -- set to allow '\' in filenames + execute('set isf=@,48-57,/,.,-,_,+,,,$,:,~,\\') + execute('/^third', '/name', 'call append(2, expand(""))') + execute('/^fourth', '/URL', 'call append(3, expand(""))') + + -- Delete the initial text, which now starts at line 5 + feed('5GdG') + + -- The buffer should now contain: + expect([[ + URL://machine.name/tmp/vimtest2a + URL://machine.name/tmp/vimtest2b + URL:\\machine.name\vimtest2c + URL:\\machine.name\tmp\vimtest2d]]) + end) +end) diff --git a/test/legacy/002_filename_recognition_spec.lua b/test/legacy/002_filename_recognition_spec.lua deleted file mode 100644 index 569e748631..0000000000 --- a/test/legacy/002_filename_recognition_spec.lua +++ /dev/null @@ -1,42 +0,0 @@ --- Test if URLs are recognized as filenames by commands such as "gf". Here --- we'll use `expand("")` since "gf" would need to open the file. - -local helpers = require('test.functional.helpers') -local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local execute, expect = helpers.execute, helpers.expect - -describe('filename recognition', function() - setup(clear) - - it('is working', function() - -- insert some lines containing URLs - insert([[ - first test for URL://machine.name/tmp/vimtest2a and other text - second test for URL://machine.name/tmp/vimtest2b. And other text - third test for URL:\\machine.name\vimtest2c and other text - fourth test for URL:\\machine.name\tmp\vimtest2d, and other text]]) - - -- Go to the first URL and append it to the beginning - execute('/^first', '/tmp', 'call append(0, expand(""))') - - -- Repeat for the second URL - -- this time, navigate to the word "URL" instead of "tmp" - execute('/^second', '/URL', 'call append(1, expand(""))') - - -- Repeat for the remaining URLs. This time, the 'isfname' option must be - -- set to allow '\' in filenames - execute('set isf=@,48-57,/,.,-,_,+,,,$,:,~,\\') - execute('/^third', '/name', 'call append(2, expand(""))') - execute('/^fourth', '/URL', 'call append(3, expand(""))') - - -- Delete the initial text, which now starts at line 5 - feed('5GdG') - - -- The buffer should now contain: - expect([[ - URL://machine.name/tmp/vimtest2a - URL://machine.name/tmp/vimtest2b - URL:\\machine.name\vimtest2c - URL:\\machine.name\tmp\vimtest2d]]) - end) -end) -- cgit