(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestCanCacheQuery(t *testing.T) { |
| 52 | testCanCacheQuery(t, "", false) |
| 53 | testCanCacheQuery(t, " ", false) |
| 54 | testCanCacheQuery(t, "INSERT aaa", false) |
| 55 | testCanCacheQuery(t, "\t INSERT aaa ", false) |
| 56 | testCanCacheQuery(t, "select", true) |
| 57 | testCanCacheQuery(t, "\t\t SELECT 123 ", true) |
| 58 | testCanCacheQuery(t, "\t\t sElECt 123 ", true) |
| 59 | testCanCacheQuery(t, " --- sd s\n /* dfsf */\n seleCT ", true) |
| 60 | testCanCacheQuery(t, " --- sd s\n /* dfsf */\n insert ", false) |
| 61 | testCanCacheQuery(t, "WITH 1 as alias SELECT alias FROM nothing ", true) |
| 62 | } |
| 63 | |
| 64 | func testCanCacheQuery(t *testing.T, q string, expected bool) { |
| 65 | t.Helper() |
nothing calls this directly
no test coverage detected