Move ne comparator below eq comparator (#119)

qb: Move ne comparator below eq comparator

Signed-off-by: pierdipi <pierangelodipilato@gmail.com>
This commit is contained in:
pierDipi
2019-11-07 15:29:22 +01:00
committed by Michal Matczuk
parent 8a02fca018
commit 180d58ce46
2 changed files with 27 additions and 27 deletions

View File

@@ -23,6 +23,16 @@ func TestCmp(t *testing.T) {
S: "eq=?",
N: []string{"eq"},
},
{
C: Ne("ne"),
S: "ne!=?",
N: []string{"ne"},
},
{
C: NeTuple("ne", 3),
S: "ne!=(?,?,?)",
N: []string{"ne_0", "ne_1", "ne_2"},
},
{
C: Lt("lt"),
S: "lt<?",
@@ -103,16 +113,6 @@ func TestCmp(t *testing.T) {
S: "like LIKE (?,?)",
N: []string{"like_0", "like_1"},
},
{
C: Ne("ne"),
S: "ne!=?",
N: []string{"ne"},
},
{
C: NeTuple("ne", 3),
S: "ne!=(?,?,?)",
N: []string{"ne_0", "ne_1", "ne_2"},
},
// Custom bind names
{
@@ -120,6 +120,11 @@ func TestCmp(t *testing.T) {
S: "eq=?",
N: []string{"name"},
},
{
C: NeNamed("ne", "name"),
S: "ne!=?",
N: []string{"name"},
},
{
C: LtNamed("lt", "name"),
S: "lt<?",
@@ -155,17 +160,16 @@ func TestCmp(t *testing.T) {
S: "cntKey CONTAINS KEY ?",
N: []string{"name"},
},
{
C: NeNamed("ne", "name"),
S: "ne!=?",
N: []string{"name"},
},
// Literals
{
C: EqLit("eq", "litval"),
S: "eq=litval",
},
{
C: NeLit("ne", "litval"),
S: "ne!=litval",
},
{
C: LtLit("lt", "litval"),
S: "lt<litval",
@@ -190,10 +194,6 @@ func TestCmp(t *testing.T) {
C: ContainsLit("cnt", "litval"),
S: "cnt CONTAINS litval",
},
{
C: NeLit("ne", "litval"),
S: "ne!=litval",
},
// Functions
{
@@ -215,6 +215,11 @@ func TestCmp(t *testing.T) {
C: EqFunc("eq", Now()),
S: "eq=now()",
},
{
C: NeFunc("ne", Fn("fn", "arg0", "arg1", "arg2")),
S: "ne!=fn(?,?,?)",
N: []string{"arg0", "arg1", "arg2"},
},
{
C: LtFunc("eq", Now()),
S: "eq<now()",
@@ -233,11 +238,6 @@ func TestCmp(t *testing.T) {
S: "eq>=maxTimeuuid(?)",
N: []string{"arg0"},
},
{
C: NeFunc("ne", Fn("fn", "arg0", "arg1", "arg2")),
S: "ne!=fn(?,?,?)",
N: []string{"arg0", "arg1", "arg2"},
},
}
buf := bytes.Buffer{}