Skip to content

Commit

Permalink
add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zhengda committed Sep 11, 2023
1 parent e7ab3e4 commit a80bbc9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions normalizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,24 @@ multiline comment */
Commands: []string{"SELECT"},
},
},
{
input: "SELECT d.id, d.uuid, d.org_id, d.creator_id, d.updater_id, d.monitor_id, d.parent_id, d.original_parent_id, d.scope, d.start_dt, d.end_dt, d.canceled_dt, d.active, d.disabled, d.created, d.modified, d.message, d.monitor_tags, d.recurrence, d.mute_first_recovery_notification, d.scope_v2_query, d.scope_v2 FROM monitor_downtime d, org o WHERE o.id = d.org_id AND d.modified >= ? AND o.partition_num = ANY (?, ?, ?)",
expected: "SELECT d.id, d.uuid, d.org_id, d.creator_id, d.updater_id, d.monitor_id, d.parent_id, d.original_parent_id, d.scope, d.start_dt, d.end_dt, d.canceled_dt, d.active, d.disabled, d.created, d.modified, d.message, d.monitor_tags, d.recurrence, d.mute_first_recovery_notification, d.scope_v2_query, d.scope_v2 FROM monitor_downtime d, org o WHERE o.id = d.org_id AND d.modified >= ? AND o.partition_num = ANY ( ? )",
statementMetadata: StatementMetadata{
Tables: []string{"monitor_downtime"},
Comments: []string{},
Commands: []string{"SELECT"},
},
},
{
input: "SELECT set_host_tags_bigint (? ARRAY[?, ?, ?])",
expected: "SELECT set_host_tags_bigint ( ? ARRAY [ ? ] )",
statementMetadata: StatementMetadata{
Tables: []string{},
Comments: []string{},
Commands: []string{"SELECT"},
},
},
}

normalizer := NewNormalizer(
Expand Down

0 comments on commit a80bbc9

Please sign in to comment.