# README
V Assertion Library
Yet another assertion library for Golang.
Quick Start
import (
. "v2ray.com/ext/assert"
)
func TestStringEquals(t *testing.T) {
assert := With(t)
str := "Hello" + " " + "World"
assert(str, Equals, "Hello World")
}
Usage
The assert
function take at least 2 parameters: assert(value, matcher, expectations...)
, where:
value
is the value to be asserted.matcher
is a "function" to assert the value.expectations
are optional parameters that will be passed intomatcher
for the assertion.
There are several predefined matchers:
- Equals
- LessThan
- GreaterThan
- AtLeast
- AtMost
- IsNil
- IsNotNil
- HasSubstring
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
With creates wrap the testing object into an assertion.
# Variables
No description provided by the author
No description provided by the author
Equals is a Matcher that expects two given values are equal to each other.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LessThan expects the given value is less than the expectation.
NotEquals is a Matcher that expects two given values are not equal to each other.
No description provided by the author
# Type aliases
Assert asserts the given value matches expectations.