From f8542af57af675c98368b7158071deaea49ce3a3 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Tue, 23 Jun 2015 18:07:48 -0400 Subject: [PATCH] add tests --- test/CDB_DistinctMeasureTest.sql | 20 ++++++++++++++++++++ test/CDB_DistinctMeasureTest_expect | 1 + 2 files changed, 21 insertions(+) create mode 100644 test/CDB_DistinctMeasureTest.sql create mode 100644 test/CDB_DistinctMeasureTest_expect diff --git a/test/CDB_DistinctMeasureTest.sql b/test/CDB_DistinctMeasureTest.sql new file mode 100644 index 0000000..ac0f7a7 --- /dev/null +++ b/test/CDB_DistinctMeasureTest.sql @@ -0,0 +1,20 @@ +-- a - j add up to 89%, k-m add up to 11% +WITH a As ( + SELECT ( + repeat('a',12) || + repeat('b',11) || + repeat('c',11) || + repeat('d',10) || + repeat('e',10) || + repeat('f',9) || + repeat('g',8) || + repeat('h',7) || + repeat('i',6) || + repeat('j',5) || + repeat('k',4) || + repeat('l',4) || + repeat('m',3) + )::text AS x + ) + +SELECT CDB_DistinctMeasure(string_to_array(x,null),0.90) from a ; \ No newline at end of file diff --git a/test/CDB_DistinctMeasureTest_expect b/test/CDB_DistinctMeasureTest_expect new file mode 100644 index 0000000..4d1ae35 --- /dev/null +++ b/test/CDB_DistinctMeasureTest_expect @@ -0,0 +1 @@ +f \ No newline at end of file