aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_filetype.vim17
-rw-r--r--src/nvim/testdir/test_fold.vim35
-rw-r--r--src/nvim/testdir/test_highlight.vim14
3 files changed, 66 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index 180170fe9a..815827e224 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -692,6 +692,23 @@ func Test_ts_file()
filetype off
endfunc
+func Test_ttl_file()
+ filetype on
+
+ call writefile(['@base <http://example.org/> .'], 'Xfile.ttl')
+ split Xfile.ttl
+ call assert_equal('turtle', &filetype)
+ bwipe!
+
+ call writefile(['looks like Tera Term Language'], 'Xfile.ttl')
+ split Xfile.ttl
+ call assert_equal('teraterm', &filetype)
+ bwipe!
+
+ call delete('Xfile.ttl')
+ filetype off
+endfunc
+
func Test_pp_file()
filetype on
diff --git a/src/nvim/testdir/test_fold.vim b/src/nvim/testdir/test_fold.vim
index 88ce64b9eb..18f328acf4 100644
--- a/src/nvim/testdir/test_fold.vim
+++ b/src/nvim/testdir/test_fold.vim
@@ -822,4 +822,39 @@ func Test_fold_create_delete()
bwipe!
endfunc
+func Test_fold_relative_move()
+ enew!
+ set fdm=indent sw=2 wrap tw=80
+
+ let content = [ ' foo', ' bar', ' baz',
+ \ repeat('x', 100),
+ \ ' foo', ' bar', ' baz'
+ \ ]
+ call append(0, content)
+
+ normal zM
+
+ call cursor(3, 1)
+ call assert_true(foldclosed(line('.')))
+ normal gj
+ call assert_equal(2, winline())
+
+ call cursor(2, 1)
+ call assert_true(foldclosed(line('.')))
+ normal 2gj
+ call assert_equal(3, winline())
+
+ call cursor(5, 1)
+ call assert_true(foldclosed(line('.')))
+ normal gk
+ call assert_equal(3, winline())
+
+ call cursor(6, 1)
+ call assert_true(foldclosed(line('.')))
+ normal 2gk
+ call assert_equal(2, winline())
+
+ set fdm& sw& wrap& tw&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim
index 8f6834c2ab..4cc4d775d1 100644
--- a/src/nvim/testdir/test_highlight.vim
+++ b/src/nvim/testdir/test_highlight.vim
@@ -2,6 +2,7 @@
source view_util.vim
source screendump.vim
+source check.vim
func Test_highlight()
" basic test if ":highlight" doesn't crash
@@ -610,3 +611,16 @@ func Test_1_highlight_Normalgroup_exists()
call assert_match('hi Normal\s*font=.*', hlNormal)
endif
endfunc
+
+" Test for using RGB color values in a highlight group
+func Test_xxlast_highlight_RGB_color()
+ CheckCanRunGui
+ gui -f
+ hi MySearch guifg=#110000 guibg=#001100 guisp=#000011
+ call assert_equal('#110000', synIDattr(synIDtrans(hlID('MySearch')), 'fg#'))
+ call assert_equal('#001100', synIDattr(synIDtrans(hlID('MySearch')), 'bg#'))
+ call assert_equal('#000011', synIDattr(synIDtrans(hlID('MySearch')), 'sp#'))
+ hi clear
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab