Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

📚 Standard module for denops.vim
Go to Latest
function assert_equal
import { assert_equal } from "https://deno.land/x/denops_std@v3.8.1/function/vim/mod.ts";

When {expected} and {actual} are not equal an error message is added to |v:errors| and 1 is returned. Otherwise zero is returned |assert-return|. There is no automatic conversion, the String "4" is different from the Number 4. And the number 4 is different from the Float 4.0. The value of 'ignorecase' is not used here, case always matters. When {msg} is omitted an error in the form "Expected {expected} but got {actual}" is produced. Example: assert_equal('foo', 'bar') Will result in a string to be added to |v:errors|: test.vim line 12: Expected 'foo' but got 'bar' ~ Can also be used as a |method|, the base is passed as the second argument: mylist->assert_equal([1, 2, 3])

Parameters

denops: Denops
expected: unknown
actual: unknown
optional
msg: unknown

Returns

Promise<unknown>