Skip to content
Snippets Groups Projects
Commit 45566243 authored by Iustin Pop's avatar Iustin Pop
Browse files

Remove special-case of "0" in niceSort


Since now niceSort is more consistently behaved, we don't have the
special casing. This should have been removed in commit a7f0953a, but
I didn't realise it.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 85a895be
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{- {-
Copyright (C) 2009, 2010, 2011, 2012 Google Inc. Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -162,16 +162,13 @@ case_niceSort_static = do ...@@ -162,16 +162,13 @@ case_niceSort_static = do
"cPRi0lM7HLnSuWA2G9", "KVQqLPDjcPjf8T3oyzjcOsfkb", "cPRi0lM7HLnSuWA2G9", "KVQqLPDjcPjf8T3oyzjcOsfkb",
"guKJkXnkULealVC8CyF1xefym", "pqF8dkU5B1cMnyZuREaSOADYx"] "guKJkXnkULealVC8CyF1xefym", "pqF8dkU5B1cMnyZuREaSOADYx"]
-- | Tests single-string behaviour of 'niceSort'. Last test is special -- | Tests single-string behaviour of 'niceSort'.
-- in the sense that /0/ is before any other non-empty string (except
-- itself, etc.).
prop_niceSort_single :: Property prop_niceSort_single :: Property
prop_niceSort_single = prop_niceSort_single =
forAll genName $ \name -> forAll genName $ \name ->
conjoin conjoin
[ printTestCase "single string" $ [name] ==? niceSort [name] [ printTestCase "single string" $ [name] ==? niceSort [name]
, printTestCase "single plus empty" $ ["", name] ==? niceSort [name, ""] , printTestCase "single plus empty" $ ["", name] ==? niceSort [name, ""]
, printTestCase "single plus 0-digit" $ ["0", name] ==? niceSort [name, "0"]
] ]
-- | Tests some generic 'niceSort' properties. Note that the last test -- | Tests some generic 'niceSort' properties. Note that the last test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment