diff options
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/dmap1b.csv.query.expected | 1 | ||||
| -rw-r--r-- | integrationtests/dmap_test.go | 31 |
2 files changed, 20 insertions, 12 deletions
diff --git a/integrationtests/dmap1b.csv.query.expected b/integrationtests/dmap1b.csv.query.expected new file mode 100644 index 0000000..f6b2d8b --- /dev/null +++ b/integrationtests/dmap1b.csv.query.expected @@ -0,0 +1 @@ +from STATS select count($line),last($time),avg($goroutines),min(concurrentConnections),max(lifetimeConnections) group by $hostname where lifetimeConnections >= 3 outfile dmap1b.csv.tmp
\ No newline at end of file diff --git a/integrationtests/dmap_test.go b/integrationtests/dmap_test.go index ec14cfb..e408b74 100644 --- a/integrationtests/dmap_test.go +++ b/integrationtests/dmap_test.go @@ -15,19 +15,26 @@ func TestDMap1(t *testing.T) { return } - query := fmt.Sprintf("from STATS select count($line),last($time)," + - "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " + - "group by $hostname") - - t.Log("Testing dmap with input file") - if err := testDmap1(t, query, "a", false); err != nil { - t.Error(err) - return + testTable := map[string]string{ + "a": "from STATS select count($line),last($time)," + + "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " + + "group by $hostname", + "b": "from STATS select count($line),last($time)," + + "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " + + "group by $hostname where lifetimeConnections >= 3", } - t.Log("Testing dmap with stdin input pipe") - if err := testDmap1(t, query, "a", true); err != nil { - t.Error(err) - return + + for subtestName, query := range testTable { + t.Log("Testing dmap with input file") + if err := testDmap1(t, query, subtestName, false); err != nil { + t.Error(err) + return + } + t.Log("Testing dmap with stdin input pipe") + if err := testDmap1(t, query, subtestName, true); err != nil { + t.Error(err) + return + } } } |
