Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add] vim-themis's test #272

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
Expand All @@ -11,34 +15,29 @@ jobs:
strategy:
matrix:
vim:
- v8.2.2000
- v8.2.1000
- v8.2.0000
- v8.1.0000
- v8.0.0000
- v7.4

steps:
- name: Checkout code
uses: actions/checkout@main
uses: actions/checkout@v3

- name: Checkout vim-themis
uses: actions/checkout@v3
with:
repository: thinca/vim-themis
path: vim-themis

- name: Setup Vim
uses: rhysd/action-setup-vim@v1
id: vim
with:
version: ${{ matrix.vim }}

- name: Install Dependencies
run: |
git clone https://github.com/junegunn/vader.vim.git
git clone https://github.com/vim-airline/vim-airline
find $PWD/autoload/airline/themes -name "*.vim" > themes.txt
- name: Run Test
run: |
vim --not-a-term -Nu <(cat << VIMRC
filetype off
set rtp+=vader.vim
set rtp+=vim-airline
set rtp+=.
set rtp+=after
filetype plugin indent on
syntax enable
VIMRC) -c 'Vader! test/*' > /dev/null
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis --reporter spec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
doc/tags
test/.deps
4 changes: 4 additions & 0 deletions test/.themisrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let s:deps = themis#helper('deps')
call s:deps.git('vim-airline/vim-airline')

call themis#helper('command')
38 changes: 0 additions & 38 deletions test/airline-themes.vader

This file was deleted.

35 changes: 35 additions & 0 deletions test/airline-themes.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
scriptencoding utf-8

let s:themes_dir = expand('<sfile>:h:h') . '/autoload/airline/themes'
let s:themes = map(glob(s:themes_dir . '/*.vim', 1, 1), 'fnamemodify(v:val, ":t:r")')
let s:suite = themis#suite('vim-airline-themes')

function! s:Test_AirlineTheme(theme)
Throws execute('AirlineTheme ' . a:theme)
endfunction

function! s:command_insert(theme)
execute('AirlineTheme ' . a:theme)
execute('source ' . expand('<sfile>:h:h') . '/autoload/airline/themes/' . a:theme . '.vim')
Throws normal! i
endfunction

function! s:command_command(theme)
execute('AirlineTheme ' . a:theme)
execute('source ' . expand('<sfile>:h:h') . '/autoload/airline/themes/' . a:theme . '.vim')
Throws normal! :
endfunction

function! s:suite.__insert__()
let child = themis#suite('INSERT')
for theme in s:themes
let child[theme] = funcref('s:command_insert', [theme])
endfor
endfunction

function! s:suite.__command__()
let child = themis#suite('COMMAND')
for theme in s:themes
let child[theme] = funcref('s:command_command', [theme])
endfor
endfunction