示例#1
0
func TestOk(t *testing.T) {
	assert.That(t, IntValue(9), is.EqualTo(9))
	assert.That(t, FloatValue(99.9), is.EqualTo(99.9))
	assert.That(t, StrValue("aaa"), is.EqualTo("aaa"))
	assert.That(t, StructValue("aaa", "bbb"), is.EqualTo(struct{ a, b string }{"aaa", "bbb"}))
	assert.That(t, StrValue("aaa"), is.EqualTo("aaa"))
	assert.That(t, StrValue("hello gopher!!"), is.Contains("gopher"))
	assert.That(t, StrValue("hello gopher!!"), is.Contains("gopher").And(is.Contains("hello")))
	assert.That(t, StrValue("hello gopher!!"), is.Contains("gopher").And(
		is.Contains("hoge").Or(is.Contains("hello"))))
}
示例#2
0
func TestLogical(t *testing.T) {
	assert.That(t, StrValue("hello gopher!!"), is.Contains("gopher").And(
		is.Contains("hoge").Or(is.Contains("moke"))))
}
示例#3
0
func TestStructValueNg(t *testing.T) {
	assert.That(t, StructValue("aaa", "bbb"), is.EqualTo(struct{ a, b string }{"aaa", "bbc"}))
}
示例#4
0
func TestStrValueContainsNg(t *testing.T) {
	assert.That(t, StrValue("hello gopher!!"), is.Contains("golang"))
}
示例#5
0
func TestStrValueNg(t *testing.T) {
	assert.That(t, StrValue("aaa"), is.EqualTo("aab"))
}
示例#6
0
func TestFloatValueNg(t *testing.T) {
	assert.That(t, FloatValue(9.876), is.EqualTo(9.875))
}
示例#7
0
func TestIntValueNg(t *testing.T) {
	assert.That(t, IntValue(9), is.EqualTo(10))
}