Beispiel #1
0
func TestNotEqual(t *testing.T) {
	neq := nodes.NotEqual(1, 2)
	expected := "1 != 2"
	if got, _ := sql.Accept(neq); expected != got {
		t.Errorf("TestNotEqual was expected to return %s, got %s", expected, got)
	}
}
Beispiel #2
0
func TestExtensiveComparison(t *testing.T) {
	comparison := nodes.Equal(1, 2).Or(nodes.NotEqual(3, 4).And(5))
	expected := "(1 = 2 OR (3 != 4 AND 5))"
	if got, _ := sql.Accept(comparison); expected != got {
		t.Errorf("TestExtensiveComparison was expected to return %s, got %s", expected, got)
	}
}
Beispiel #3
0
func TestNotEqual(t *testing.T) {
	neq := nodes.NotEqual(1, 2)

	// The following struct members should exist.
	_ = neq.Left
	_ = neq.Right

	// The following receiver methods should exist.
	_ = neq.Or(1)
	_ = neq.And(1)
	_ = neq.Not()
}