1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 09:20:06 +08:00
SpaceVim/test/api/vim/regex.vader
2020-10-17 23:21:52 +08:00

14 lines
636 B
Plaintext

Execute ( SpaceVim api: vim#key ):
let regex = SpaceVim#api#import('vim#regex')
AssertEqual regex.parser('(?i)abc', 0), '\v\cabc'
AssertEqual regex.parser('(?-i)abc', 0), '\v\Cabc'
AssertEqual regex.parser('(?:exp)', 0), '\v%(exp)'
AssertEqual regex.parser('\a\f\v', 0), '\v%x07%x0C%x0B'
AssertEqual regex.parser('[:word:]', 0), '\v[0-9A-Za-z_]'
AssertEqual regex.parser('\bspace\b', 0), '\v<space>'
AssertEqual regex.parser('\bspace', 0), '\v<space'
AssertEqual regex.parser('space\b', 0), '\vspace>'
AssertEqual regex.parser('if%@&ab', 0), '\vif\%\@\&ab'
AssertEqual regex.parser('(?P<name>exp)', 0), '\v(exp)'