From 7e131ac88d1f8964ea9324901e9968121b8b44c8 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Mon, 10 Sep 2018 16:13:25 +0200 Subject: [PATCH] Jenks: Add test for less data than breaks --- test/CDB_JenksBinsTest.sql | 6 ++++++ test/CDB_JenksBinsTest_expect | 3 +++ 2 files changed, 9 insertions(+) diff --git a/test/CDB_JenksBinsTest.sql b/test/CDB_JenksBinsTest.sql index 0f97e1c..8b55b0b 100644 --- a/test/CDB_JenksBinsTest.sql +++ b/test/CDB_JenksBinsTest.sql @@ -28,3 +28,9 @@ WITH data_inverse AS ( 20.1, 19.9]::numeric[] AS s ) SELECT unnest(CDB_JenksBins(s, 5, 0, true)) FROM data_inverse; + + +WITH data_small AS ( + SELECT Array[0.99, 1.0, 10.01, 10.01, 10.01, 10.01]::numeric[] AS s +) +SELECT unnest(CDB_JenksBins(s, 4)) FROM data_small; diff --git a/test/CDB_JenksBinsTest_expect b/test/CDB_JenksBinsTest_expect index 462c675..0dfaa43 100644 --- a/test/CDB_JenksBinsTest_expect +++ b/test/CDB_JenksBinsTest_expect @@ -13,3 +13,6 @@ 10.01 14.99 19.9 +0.99 +1.0 +10.01