From 272d5be776c230707feb118a86a3baa12e3f7b43 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Mon, 10 Sep 2018 15:42:54 +0200 Subject: [PATCH] Jenks: Add inverse request test --- test/CDB_JenksBinsTest.sql | 12 +++++++++++- test/CDB_JenksBinsTest_expect | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/CDB_JenksBinsTest.sql b/test/CDB_JenksBinsTest.sql index de0dbf4..0f97e1c 100644 --- a/test/CDB_JenksBinsTest.sql +++ b/test/CDB_JenksBinsTest.sql @@ -17,4 +17,14 @@ WITH data_nulls AS ( null, null, 20.1, 19.9]::numeric[] AS s ) -SELECT unnest(CDB_JenksBins(s, 5)) FROM data; +SELECT unnest(CDB_JenksBins(s, 5)) FROM data_nulls; + + +WITH data_inverse AS ( + SELECT Array[0.99, 1.0, 1.01, + 4.99, 5.01, + 10.01, 10.01, + 15.01, 14.99, + 20.1, 19.9]::numeric[] AS s +) +SELECT unnest(CDB_JenksBins(s, 5, 0, true)) FROM data_inverse; diff --git a/test/CDB_JenksBinsTest_expect b/test/CDB_JenksBinsTest_expect index 0802fec..462c675 100644 --- a/test/CDB_JenksBinsTest_expect +++ b/test/CDB_JenksBinsTest_expect @@ -8,4 +8,8 @@ 10.01 15.01 20.1 - +0.99 +4.99 +10.01 +14.99 +19.9