From df646572c53f55268a5dbb61628d7c3b302d5663 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 30 Sep 2022 09:53:52 +0200 Subject: docs: fix typos (#20394) Co-authored-by: Raphael Co-authored-by: smjonas Co-authored-by: zeertzjq --- test/functional/lua/uri_spec.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/functional/lua/uri_spec.lua') diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua index 4635f17557..2cb0b26c6d 100644 --- a/test/functional/lua/uri_spec.lua +++ b/test/functional/lua/uri_spec.lua @@ -11,7 +11,7 @@ describe('URI methods', function() describe('file path to uri', function() describe('encode Unix file path', function() - it('file path includes only ascii charactors', function() + it('file path includes only ascii characters', function() exec_lua("filepath = '/Foo/Bar/Baz.txt'") eq('file:///Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) @@ -23,7 +23,7 @@ describe('URI methods', function() eq('file:///Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) end) - it('file path including Unicode charactors', function() + it('file path including Unicode characters', function() exec_lua("filepath = '/xy/åäö/ɧ/汉语/↥/🤦/🦄/å/بِيَّ.txt'") -- The URI encoding should be case-insensitive @@ -32,7 +32,7 @@ describe('URI methods', function() end) describe('encode Windows filepath', function() - it('file path includes only ascii charactors', function() + it('file path includes only ascii characters', function() exec_lua([[filepath = 'C:\\Foo\\Bar\\Baz.txt']]) eq('file:///C:/Foo/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) @@ -44,7 +44,7 @@ describe('URI methods', function() eq('file:///C:/Foo%20/Bar/Baz.txt', exec_lua("return vim.uri_from_fname(filepath)")) end) - it('file path including Unicode charactors', function() + it('file path including Unicode characters', function() exec_lua([[filepath = 'C:\\xy\\åäö\\ɧ\\汉语\\↥\\🤦\\🦄\\å\\بِيَّ.txt']]) eq('file:///C:/xy/%c3%a5%c3%a4%c3%b6/%c9%a7/%e6%b1%89%e8%af%ad/%e2%86%a5/%f0%9f%a4%a6/%f0%9f%a6%84/a%cc%8a/%d8%a8%d9%90%d9%8a%d9%8e%d9%91.txt', exec_lua("return vim.uri_from_fname(filepath)")) @@ -72,7 +72,7 @@ describe('URI methods', function() eq('/Foo /Bar/Baz.txt', exec_lua("return vim.uri_to_fname(uri)")) end) - it('file path including Unicode charactors', function() + it('file path including Unicode characters', function() local test_case = [[ local uri = 'file:///xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt' return vim.uri_to_fname(uri) @@ -83,7 +83,7 @@ describe('URI methods', function() end) describe('decode Windows filepath', function() - it('file path includes only ascii charactors', function() + it('file path includes only ascii characters', function() local test_case = [[ local uri = 'file:///C:/Foo/Bar/Baz.txt' return vim.uri_to_fname(uri) @@ -119,7 +119,7 @@ describe('URI methods', function() eq('C:\\Foo \\Bar\\Baz.txt', exec_lua(test_case)) end) - it('file path including Unicode charactors', function() + it('file path including Unicode characters', function() local test_case = [[ local uri = 'file:///C:/xy/%C3%A5%C3%A4%C3%B6/%C9%A7/%E6%B1%89%E8%AF%AD/%E2%86%A5/%F0%9F%A4%A6/%F0%9F%A6%84/a%CC%8A/%D8%A8%D9%90%D9%8A%D9%8E%D9%91.txt' return vim.uri_to_fname(uri) -- cgit From 736c36c02f316c979da363c5120495179a2b6c2a Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:52:19 +0100 Subject: test: introduce skip() #21010 This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`. --- test/functional/lua/uri_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/functional/lua/uri_spec.lua') diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua index 2cb0b26c6d..38c7801d55 100644 --- a/test/functional/lua/uri_spec.lua +++ b/test/functional/lua/uri_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local exec_lua = helpers.exec_lua local eq = helpers.eq +local iswin = helpers.iswin +local skip = helpers.skip local write_file = require('test.helpers').write_file describe('URI methods', function() @@ -167,7 +169,7 @@ describe('URI methods', function() describe('uri from bufnr', function() it('Windows paths should not be treated as uris', function() - if not helpers.iswin() then return end + skip(not iswin(), "Not applicable on non-Windows") local file = helpers.tmpname() write_file(file, 'Test content') -- cgit From 5eb5f4948826e9d47685ea9e257409cc3e693614 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 22 Nov 2022 01:13:30 +0100 Subject: test: simplify platform detection (#21020) Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`. --- test/functional/lua/uri_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/lua/uri_spec.lua') diff --git a/test/functional/lua/uri_spec.lua b/test/functional/lua/uri_spec.lua index 38c7801d55..416e9e1f02 100644 --- a/test/functional/lua/uri_spec.lua +++ b/test/functional/lua/uri_spec.lua @@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local clear = helpers.clear local exec_lua = helpers.exec_lua local eq = helpers.eq -local iswin = helpers.iswin +local is_os = helpers.is_os local skip = helpers.skip local write_file = require('test.helpers').write_file @@ -169,7 +169,7 @@ describe('URI methods', function() describe('uri from bufnr', function() it('Windows paths should not be treated as uris', function() - skip(not iswin(), "Not applicable on non-Windows") + skip(not is_os('win'), "Not applicable on non-Windows") local file = helpers.tmpname() write_file(file, 'Test content') -- cgit