Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
[add] config file

debug

[add] test

[fix] devicons-test

debug commit

debug commit

fix test-name

may test fail

fix
  • Loading branch information
get-me-power committed May 7, 2020
1 parent d6ae80a commit 2c2d778
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
name: ci
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
on: [push, pull_request]

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

vim:
- v8.2.0000
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Checkout code
uses: actions/checkout@master
- name: Checkout vim-themis
uses: actions/checkout@master
with:
repository: thinca/vim-themis
path: vim-themis
- name: Setup Vim
uses: rhysd/action-setup-vim@v1
id: vim
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install vint
run: |
pip install vim-vint
- name: Test with vint
run: |
vint --verbose --stat $(find . -type f -name '*.vim')
version: ${{ matrix.vim }}
- name: Test
env:
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
run: ./vim-themis/bin/themis --reporter spec
32 changes: 32 additions & 0 deletions .github/workflows/vint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install vint
run: |
pip install vim-vint
- name: Test with vint
run: |
vint --verbose --stat $(find . -type f -name '*.vim')
1 change: 1 addition & 0 deletions test/.themisrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
filetype plugin on
11 changes: 11 additions & 0 deletions test/fileformat.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scriptencoding utf-8

" Please use nerd-font if you watch icon-font

let s:suite = themis#suite('WebDevIconsGetFileFormatSymbol')
let s:assert = themis#helper('assert')

" It may return Ubuntu because github-actions's OS is Ubuntu
function! s:suite.DefaultIcon()
call s:assert.equals('', WebDevIconsGetFileFormatSymbol())
endfunction
22 changes: 22 additions & 0 deletions test/filetype.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
scriptencoding utf-8

" Please use nerd-font if you watch icon-font

let s:suite = themis#suite('WebDevIconsGetFileTypeSymbol')
let s:assert = themis#helper('assert')

function! s:suite.FileNodesDefaultSymbol()
call s:assert.equals('', WebDevIconsGetFileTypeSymbol())
endfunction

function! s:suite.VimSymbol()
call s:assert.equals('', WebDevIconsGetFileTypeSymbol('.vimrc'))
endfunction

function! s:suite.LicenseSymbol()
call s:assert.equals('', WebDevIconsGetFileTypeSymbol('LICENSE'))
endfunction

function! s:suite.MarkdownSymbol()
call s:assert.equals('', WebDevIconsGetFileTypeSymbol('test.md'))
endfunction

0 comments on commit 2c2d778

Please sign in to comment.