Index: perf/go/parser/parser_test.go |
diff --git a/perf/go/parser/parser_test.go b/perf/go/parser/parser_test.go |
index 71fbebf5790e8fea8292a02584a59d684212c3ad..57110c6cafd9cc0998fd2ffa236d24ba3ac9c51e 100644 |
--- a/perf/go/parser/parser_test.go |
+++ b/perf/go/parser/parser_test.go |
@@ -131,6 +131,19 @@ func TestAve(t *testing.T) { |
} |
} |
+func TestRatio(t *testing.T) { |
+ ctx := newTestContext() |
+ ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{10, 4, 100, 50} |
+ ctx.Tile.Traces["t2"].(*types.PerfTrace).Values = []float64{5, 2, 4, 5} |
jcgregorio
2014/10/18 00:19:13
Add a divide by zero case to the tests.
tfarina
2014/10/18 03:15:46
Done.
|
+ |
+ _, err := ctx.Eval(`ratio( |
+ ave(fill(filter("config=gpu"))), |
+ ave(fill(filter("config=8888"))))`) |
+ if err != nil { |
+ t.Fatalf("Failed to eval ratio() test: %s", err) |
+ } |
jcgregorio
2014/10/18 00:19:13
Add tests for the values coming from the result of
tfarina
2014/10/18 03:15:46
Done.
|
+} |
+ |
func TestFill(t *testing.T) { |
ctx := newTestContext() |
ctx.Tile.Traces["t1"].(*types.PerfTrace).Values = []float64{1e100, 1e100, 2, 3, 1e100, 5} |