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)
	}
}
func TestEqual(t *testing.T) {
	eq := nodes.Equal(1, 2)
	expected := "1 = 2"
	if got, _ := sql.Accept(eq); expected != got {
		t.Errorf("TestEqual was expected to return %s, got %s", expected, got)
	}
}
Exemple #3
0
func TestEqual(t *testing.T) {
	eq := nodes.Equal(1, 2)

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

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