From 0a8365753beed362a8f45fd0a0aa4019bfccf077 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 21 May 2024 15:37:44 +0200 Subject: [PATCH] wip --- lib/stringsutil/less_natural_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/stringsutil/less_natural_test.go b/lib/stringsutil/less_natural_test.go index 1de93e2e9..4e4b1e100 100644 --- a/lib/stringsutil/less_natural_test.go +++ b/lib/stringsutil/less_natural_test.go @@ -39,6 +39,16 @@ func TestLessNatural(t *testing.T) { f("123", "99", false) f("99", "123", true) + // negative numbers (works unexpectedly - this is OK for natural sort order) + f("-93", "5", false) + f("5", "-93", true) + f("-9", "-5", false) + f("-5", "-9", true) + f("-93", "foo", true) + f("foo", "-93", false) + f("foo-9", "foo-10", true) + f("foo-10", "foo-9", false) + // floating-point comparsion (works unexpectedly - this is OK for natural sort order) f("1.23", "1.123", true) f("1.123", "1.23", false)