From d72dd2edaa58d3d7cf84d0b07f99337447514470 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Sun, 7 Jun 2015 23:03:26 +0200 Subject: use Sized from shapeless --- .../scala/org/xapek/influxdb/InfluxdbTest.scala | 24 +++++++++++----------- src/test/scala/org/xapek/influxdb/SizedTest.scala | 22 -------------------- 2 files changed, 12 insertions(+), 34 deletions(-) delete mode 100644 src/test/scala/org/xapek/influxdb/SizedTest.scala (limited to 'src/test/scala/org/xapek') diff --git a/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala b/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala index 4473a47..2ec83c3 100644 --- a/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala +++ b/src/test/scala/org/xapek/influxdb/InfluxdbTest.scala @@ -16,7 +16,7 @@ class AppTest { assertTrue((SELECT("foo")("bla") FROM "bla" WHERE col("a") == "asd") .toString().contains("foo")) - + assertTrue((SELECT("foo")("bla") FROM "bla" WHERE col("b") == 1) .toString().contains("\"b\" = 1")) @@ -30,16 +30,16 @@ class AppTest { FROM "bla" WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d").toString().contains("foo")) - // assertTrue((Influxdb - // SELECT "foo" - // FROM "bla" - // WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" - // GROUP_BY "asd").toString().contains("GROUP BY")) - - // assertTrue((Influxdb - // SELECT col("foo") - // FROM "bla" - // WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" - // GROUP_BY "asd" <<= "asd2").toString().contains("asd2")) + assertTrue(( + SELECT("foo") + FROM "bla" + WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" + GROUP_BY "asd").toString().contains("GROUP BY")) + + assertTrue((( + SELECT("foo") + FROM "bla" + WHERE (col("a") == "asd" || col("b") == "C") && col("c") == "d" + GROUP_BY ("asd"))("asdasd")).toString().contains("asdasd")) } } diff --git a/src/test/scala/org/xapek/influxdb/SizedTest.scala b/src/test/scala/org/xapek/influxdb/SizedTest.scala deleted file mode 100644 index 525ffd9..0000000 --- a/src/test/scala/org/xapek/influxdb/SizedTest.scala +++ /dev/null @@ -1,22 +0,0 @@ -package org.xapek.influxdb - -import org.junit._ -import org.junit.Assert._ - -@Test -class SizedTest { - @Test - def testStatements() = { - val s1 = SizedOp.wrap("abc") - assertEquals(1, SizedOp.count(s1)) - assertEquals(List("abc"), s1.unsized) - - val s2 = SizedOp.add(s1, "cde") - assertEquals(2, SizedOp.count(s2)) - assertEquals(List("abc", "cde"), s2.unsized) - - val s3 = SizedOp.add(s2, "fgh") - assertEquals(SizedOp.count(s3), 3) - assertEquals(List("abc", "cde", "fgh"), s3.unsized) - } -} -- cgit v1.2.1