Skip to content

Commit

Permalink
fix ut TestMergeSQLsByFingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
BugsGuru committed Dec 9, 2024
1 parent 3d65b06 commit 9ac8dc7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sqle/server/auditplan/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
want: []sqlInfo{
{
counter: 1,
fingerprint: "select sleep(?)",
fingerprint: "SELECT SLEEP(?)",
sql: "select sleep(2)",
},
},
Expand All @@ -44,7 +44,7 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
want: []sqlInfo{
{
counter: 3,
fingerprint: "select sleep(?)",
fingerprint: "SELECT SLEEP(?)",
sql: "select sleep(3)",
},
},
Expand All @@ -53,7 +53,7 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
want: []sqlInfo{
{
counter: 1,
fingerprint: "select * from tb1 where a=?",
fingerprint: "SELECT * FROM `tb1` WHERE `a`=?",
sql: "select * from tb1 where a=1",
},
},
Expand All @@ -72,7 +72,7 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
want: []sqlInfo{
{
counter: 3,
fingerprint: "select * from tb1 where a=?",
fingerprint: "SELECT * FROM `tb1` WHERE `a`=?",
sql: "select * from tb1 where a=3",
},
},
Expand All @@ -94,12 +94,12 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
want: []sqlInfo{
{
counter: 2,
fingerprint: "select * from tb1 where a=?",
fingerprint: "SELECT * FROM `tb1` WHERE `a`=?",
sql: "select * from tb1 where a=3",
},
{
counter: 2,
fingerprint: "select sleep(?)",
fingerprint: "SELECT SLEEP(?)",
sql: "select sleep(4)",
},
},
Expand All @@ -109,7 +109,7 @@ func TestMergeSQLsByFingerprint(t *testing.T) {
for i, tt := range tests {
t.Run(fmt.Sprintf("test sqls NO.%v", i), func(t *testing.T) {
actual := mergeSQLsByFingerprint(nil, tt.sqls)
if !assert.EqualValues(t, actual, tt.want) {
if !assert.EqualValues(t, tt.want, actual) {
t.Fatal("unexpected result")
}
})
Expand Down

0 comments on commit 9ac8dc7

Please sign in to comment.