Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/vim/mod.ts>assert_match

๐Ÿ“š Standard module for denops.vim
Go to Latest
function assert_match
import { assert_match } from "https://deno.land/x/denops_std@v3.9.0/function/vim/mod.ts";

When {pattern} does not match {actual} an error message is added to |v:errors|. Also see |assert-return|. {pattern} is used as with |=~|: The matching is always done like 'magic' was set and 'cpoptions' is empty, no matter what the actual value of 'magic' or 'cpoptions' is. {actual} is used as a string, automatic conversion applies. Use "^" and "$" to match with the start and end of the text. Use both to match the whole text. When {msg} is omitted an error in the form "Pattern {pattern} does not match {actual}" is produced. Example: assert_match('^f.*o$', 'foobar') Will result in a string to be added to |v:errors|: test.vim line 12: Pattern '^f.o$' does not match 'foobar' ~ Can also be used as a |method|: getFile()->assert_match('foo.')

Parameters

denops: Denops
pattern: unknown
actual: unknown
optional
msg: unknown

Returns

Promise<unknown>