Skip to content

Commit

Permalink
Version 0.0.4
Browse files Browse the repository at this point in the history
- Add additional syntax file for |vspec-commands|.- |:Should|: Provide expression completion for convenience.- Improve minor stuffs.
  • Loading branch information
Kana Natsuno authored and vim-scripts committed Nov 14, 2010
1 parent e241eaa commit 484aa52
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .mduem/cache/Makefile.variables
@@ -1,6 +1,6 @@
all_files_in_repos := Makefile autoload/vspec.vim bin/vspec doc/vspec.txt test/context.expected test/context.input test/custom-matcher.expected test/custom-matcher.input test/no-test.expected test/no-test.input test/tools.expected test/tools.input test/typical-content.expected test/typical-content.input
all_files_in_repos := Makefile after/syntax/vim/vspec.vim autoload/vspec.vim bin/vspec doc/vspec.txt test/context.expected test/context.input test/custom-matcher.expected test/custom-matcher.input test/no-test.expected test/no-test.input test/syntax.expected test/syntax.input test/tools.expected test/tools.input test/typical-content.expected test/typical-content.input
current_branch := master
origin_name := origin
origin_uri := ../.
repos_name := vim-vspec
version := 0.0.3
version := 0.0.4
1 change: 1 addition & 0 deletions Makefile
@@ -1,5 +1,6 @@
# Makefile for vim-vspec

REPOS_TYPE := vim-script
INSTALLATION_DIR := $(HOME)/.vim
TARGETS_STATIC = $(filter %.vim %.txt,$(all_files_in_repos))
TARGETS_ARCHIVED = $(all_files_in_repos) mduem/Makefile
Expand Down
39 changes: 39 additions & 0 deletions after/syntax/vim/vspec.vim
@@ -0,0 +1,39 @@
" Vim additional syntax: vim/vspec - highlight vspec commands
" Version: 0.0.4
" Copyright (C) 2010 kana <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}

syntax keyword vimVspecCommand It skipwhite nextgroup=vimVspecItArgument
syntax keyword vimVspecCommand ResetContext
syntax keyword vimVspecCommand SaveContext
syntax keyword vimVspecCommand Should skipwhite nextgroup=vimFunc,vimString

syntax match vimVspecItArgument /\S.*$/ contained




highlight default link vimVspecCommand vimCommand
highlight default link vimVspecItArgument String

" __END__
" vim: foldmethod=marker
6 changes: 3 additions & 3 deletions autoload/vspec.vim
@@ -1,7 +1,7 @@
" vspec - Test framework for Vim script
" Version: 0.0.3
" Version: 0.0.4
" Copyright (C) 2009-2010 kana <http://whileimautomaton.net/>
" License: MIT license {{{
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
Expand Down Expand Up @@ -215,7 +215,7 @@ command! -nargs=+ It call vspec#cmd_It(<q-args>)
command! -nargs=0 ResetContext call vspec#cmd_ResetContext()
command! -nargs=0 SaveContext call vspec#cmd_SaveContext()

command! -nargs=+ Should
command! -complete=expression -nargs=+ Should
\ call vspec#cmd_Should(s:parse_should_args(<q-args>, 'raw'),
\ map(s:parse_should_args(<q-args>, 'eval'),
\ 'eval(v:val)'))
Expand Down
26 changes: 25 additions & 1 deletion bin/vspec
@@ -1,4 +1,27 @@
#!/bin/bash
# bin/vspec - Driver script to test Vim script
# Version: 0.0.4
# Copyright (C) 2009-2010 kana <http://whileimautomaton.net/>
# License: So-called MIT/X license {{{
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# }}}

if [ "$#" = '0' ] || [ "$1" = '-h' ] || [ "$1" = '--help' ]
then
Expand Down Expand Up @@ -36,4 +59,5 @@ vim -u NONE -i NONE -N -e -s -S "$driver_script" 2>&1 | sed "s|$(pwd)|.|g"

rm -f "$driver_script"

#__END__
# __END__
# vim: foldmethod=marker
1 change: 1 addition & 0 deletions doc/tags
Expand Up @@ -19,6 +19,7 @@ vspec-changelog-0.0.0 vspec.txt /*vspec-changelog-0.0.0*
vspec-changelog-0.0.1 vspec.txt /*vspec-changelog-0.0.1*
vspec-changelog-0.0.2 vspec.txt /*vspec-changelog-0.0.2*
vspec-changelog-0.0.3 vspec.txt /*vspec-changelog-0.0.3*
vspec-changelog-0.0.4 vspec.txt /*vspec-changelog-0.0.4*
vspec-commands vspec.txt /*vspec-commands*
vspec-contents vspec.txt /*vspec-contents*
vspec-custom-matcher vspec.txt /*vspec-custom-matcher*
Expand Down
9 changes: 7 additions & 2 deletions doc/vspec.txt
@@ -1,9 +1,9 @@
*vspec.txt* Test framework for Vim script

Version 0.0.3
Version 0.0.4
Script ID: 3012
Copyright (C) 2009-2010 kana <http://whileimautomaton.net/>
License: MIT license {{{
License: So-called MIT/X license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
Expand Down Expand Up @@ -281,6 +281,11 @@ ETC ~
==============================================================================
CHANGELOG *vspec-changelog*

0.0.4 2010-04-04T20:59:35+09:00 *vspec-changelog-0.0.4*
- Add additional syntax file for |vspec-commands|.
- |:Should|: Provide expression completion for convenience.
- Improve minor stuffs.

0.0.3 2010-03-12T21:43:12+09:00 *vspec-changelog-0.0.3*
- Add test driver |bin/vspec|.

Expand Down
15 changes: 10 additions & 5 deletions mduem/Makefile
Expand Up @@ -15,7 +15,7 @@
#
# - Use suffix "_p" to indicate that a boolean value is resulted from
# a variable.
# Example: vim_script_repos_p, SHOULD_INSTALL_ASIS_P
# Example: SHOULD_INSTALL_ASIS_P
#
# - Use noun for ordinary variables.
# Example: repos_name, TARGETS_GENERATED
Expand Down Expand Up @@ -100,7 +100,12 @@ $(cache_makefile): \
endif
include $(cache_makefile)

vim_script_repos_p := $(filter vim-%,$(repos_name))
# The type of a repository. It must be one of the following values:
#
# generic For any software.
# vim-script For Vim plugins, etc.
REPOS_TYPE ?= $(if $(filter vim-%,$(repos_name)),vim-script,generic)
vim_script_repos_p := $(filter vim-script,$(REPOS_TYPE))



Expand Down Expand Up @@ -177,10 +182,10 @@ vim_script_deps := $(if $(vim_script_repos_p),vim-vspec vimup,)
all_deps := $(vim_script_deps) $(DEPS)

DEP_vim_vspec_URI ?= ../vim-vspec
DEP_vim_vspec_VERSION ?= 0.0.3a1
DEP_vim_vspec_VERSION ?= 0.0.3

DEP_vimup_URI ?= ../vimup
DEP_vimup_VERSION ?= 0.0.0a1
DEP_vimup_VERSION ?= 0.0.0a3


# BUGS: This resolves "../" just once, but it's enough for usual cases.
Expand Down Expand Up @@ -251,7 +256,7 @@ $(2): $(1)
ifneq '$(call SHOULD_INSTALL_ASIS_P,$(1))' ''
@cp '$(1)' '$(2)'
else
@sed -e 's/0.0.3/$(version)/' '$(1)' >'$(2)'
@sed -e 's/0.0.4/$(version)/' '$(1)' >'$(2)'
endif

endef
Expand Down
12 changes: 12 additions & 0 deletions test/syntax.expected
@@ -0,0 +1,12 @@
==== highlighting
---- It should highlight :It properly.
.........................
---- It should highlight :Should properly.
...................................



**** Result ****


60 examples, 0 failures
105 changes: 105 additions & 0 deletions test/syntax.input
@@ -0,0 +1,105 @@
" Common set up "{{{1

silent filetype plugin on
syntax enable

function! SynStack(lnum, col)
return map(synstack(a:lnum, a:col), 'synIDattr(v:val, "name")')
endfunction




function! s:describe__highlighting() "{{{1
tabnew
tabonly!

silent put =[
\ 'It should be highlighted.',
\ 'Should 123 be true',
\ 'Should string('''') ==# ''''',
\ ]
1 delete _

setfiletype vim

It should highlight :It properly.

Should SynStack(1, 1) ==# ['vimVspecCommand']
Should SynStack(1, 2) ==# ['vimVspecCommand']
Should SynStack(1, 3) ==# []
Should SynStack(1, 4) ==# ['vimVspecItArgument']
Should SynStack(1, 5) ==# ['vimVspecItArgument']
Should SynStack(1, 6) ==# ['vimVspecItArgument']
Should SynStack(1, 7) ==# ['vimVspecItArgument']
Should SynStack(1, 8) ==# ['vimVspecItArgument']
Should SynStack(1, 9) ==# ['vimVspecItArgument']
Should SynStack(1, 10) ==# ['vimVspecItArgument']
Should SynStack(1, 11) ==# ['vimVspecItArgument']
Should SynStack(1, 12) ==# ['vimVspecItArgument']
Should SynStack(1, 13) ==# ['vimVspecItArgument']
Should SynStack(1, 14) ==# ['vimVspecItArgument']
Should SynStack(1, 15) ==# ['vimVspecItArgument']
Should SynStack(1, 16) ==# ['vimVspecItArgument']
Should SynStack(1, 17) ==# ['vimVspecItArgument']
Should SynStack(1, 18) ==# ['vimVspecItArgument']
Should SynStack(1, 19) ==# ['vimVspecItArgument']
Should SynStack(1, 20) ==# ['vimVspecItArgument']
Should SynStack(1, 21) ==# ['vimVspecItArgument']
Should SynStack(1, 22) ==# ['vimVspecItArgument']
Should SynStack(1, 23) ==# ['vimVspecItArgument']
Should SynStack(1, 24) ==# ['vimVspecItArgument']
Should SynStack(1, 25) ==# ['vimVspecItArgument']

It should highlight :Should properly.

Should SynStack(2, 1) ==# ['vimVspecCommand']
Should SynStack(2, 2) ==# ['vimVspecCommand']
Should SynStack(2, 3) ==# ['vimVspecCommand']
Should SynStack(2, 4) ==# ['vimVspecCommand']
Should SynStack(2, 5) ==# ['vimVspecCommand']
Should SynStack(2, 6) ==# ['vimVspecCommand']
Should SynStack(2, 7) ==# []
Should SynStack(2, 8) ==# ['vimNumber']
Should SynStack(2, 9) ==# ['vimNumber']
Should SynStack(2, 10) ==# ['vimNumber']
Should SynStack(2, 11) ==# []
" Should SynStack(2, 12) ==# []
" Should SynStack(2, 13) ==# []
" Should SynStack(2, 14) ==# []
" Should SynStack(2, 15) ==# []
" Should SynStack(2, 16) ==# []
" Should SynStack(2, 17) ==# []
" Should SynStack(2, 18) ==# []

Should SynStack(3, 1) ==# ['vimVspecCommand']
Should SynStack(3, 2) ==# ['vimVspecCommand']
Should SynStack(3, 3) ==# ['vimVspecCommand']
Should SynStack(3, 4) ==# ['vimVspecCommand']
Should SynStack(3, 5) ==# ['vimVspecCommand']
Should SynStack(3, 6) ==# ['vimVspecCommand']
Should SynStack(3, 7) ==# []
Should SynStack(3, 8) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 9) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 10) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 11) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 12) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 13) ==# ['vimFunc', 'vimFuncName']
Should SynStack(3, 14) ==# ['vimOperParen', 'vimOper']
Should SynStack(3, 15) ==# ['vimOperParen', 'vimString']
Should SynStack(3, 16) ==# ['vimOperParen', 'vimString']
Should SynStack(3, 17) ==# ['vimOper']
Should SynStack(3, 18) ==# []
Should SynStack(3, 19) ==# ['vimOper']
Should SynStack(3, 20) ==# ['vimOper']
Should SynStack(3, 21) ==# ['vimOper']
Should SynStack(3, 22) ==# []
Should SynStack(3, 23) ==# ['vimString']
Should SynStack(3, 24) ==# ['vimString']
endfunction




" __END__ "{{{1
" vim: filetype=vim foldmethod=marker

0 comments on commit 484aa52

Please sign in to comment.