let s:expect = themis#helper('expect')
let g:CachePairs = autopairs#AutoPairsDefine({})
let g:AutoPairsForceDefine = 69420
let g:Assert = themis#helper("assert")

" Some plugin apparently changes the tex filetype
" to plaintex, which breaks stuff:tm:
" This ensures it doesn't
let g:tex_flavor = 'latex'

syntax on
filetype plugin indent on
set noswapfile

" We have to set this to make sure indent-sensitive checks work as expected.
" This is largely just to make sure indent changes don't break working tests
set expandtab
set sw=2

" Not sure why I have to use a function to forward, but okay
fun! Expect(input)
    return s:expect(a:input)
endfun

fun! CheckBuffImpl(input, output)
    return join(getline(1, '$'), '\n') ==# a:output
endfun

fun! ToMatchImpl(input, output)
    %d " Clear the file
    execute 'normal i' . a:input
    return join(getline(1, '$'), '\n') ==# a:output
endfun

call themis#helper#expect#define_matcher('CheckBuff', function('CheckBuffImpl'), '"Expected:\n" . a:2 . "\nActual:\n". join(getline(1, ''$''), ''\n'')')
call themis#helper#expect#define_matcher('ToMatch', function('ToMatchImpl'), '"Expected:\n" . a:2 . "\nActual:\n". join(getline(1, ''$''), ''\n'')')
