Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hattya committed May 21, 2023
1 parent 84add11 commit decdfda
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2022 Akinori Hattori <hattya@gmail.com>
Copyright (c) 2015-2023 Akinori Hattori <hattya@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 35 additions & 2 deletions test/indent.vimspec
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ Describe filetype indent

It indents like the previous line (triple-quoted string)
let in = "def func():\<CR>"
let in .= "s = '''\\\<CR>0\<C-D>spam\<CR>ham\<CR>eggs\<CR>'''\<CR>"
let in .= "s = '''\\\<CR>0\<C-D>spam\<CR>eggs\<CR>ham\<CR>'''\<CR>"
let in .= "v ="
let out = [
\ 'def func():',
\ " s = '''\\",
\ 'spam',
\ 'ham',
\ 'eggs',
\ 'ham',
\ "'''",
\ ' v =',
\]
Expand Down Expand Up @@ -308,6 +308,39 @@ Describe filetype indent
\]
Assert Equals(Insert(in), Buffer(out))
End

It indents by the option value (hanging indent)
let in = "def func(\<CR>*args,\<CR>**kwargs\<CR>):"
let out = [
\ 'def func(',
\ ' *args,',
\ ' **kwargs',
\ '):',
\]
Assert Equals(Insert(in), Buffer(out))
End

It decreases the indent level after pass
let in = "def spam():\<CR>pass\<CR>"
let in .= "def eggs():"
let out = [
\ 'def spam():',
\ ' pass',
\ 'def eggs():',
\]
Assert Equals(Insert(in), Buffer(out))
End

It decreases the indent level after return
let in = "def spam():\<CR>return\<CR>"
let in .= "def eggs():"
let out = [
\ 'def spam():',
\ ' return',
\ 'def eggs():',
\]
Assert Equals(Insert(in), Buffer(out))
End
End

Describe if statement
Expand Down

0 comments on commit decdfda

Please sign in to comment.