From 390d5927a42211b09776fdb3cfe58ea58a8f4bb6 Mon Sep 17 00:00:00 2001 From: Chris van Marle Date: Thu, 12 Oct 2017 14:22:35 +0200 Subject: [PATCH] BugFix: compare odd size elements, like empty line --- src/core/operations/SeqUtils.js | 2 +- test/tests/operations/SeqUtils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/operations/SeqUtils.js b/src/core/operations/SeqUtils.js index 70207e00..3272e706 100755 --- a/src/core/operations/SeqUtils.js +++ b/src/core/operations/SeqUtils.js @@ -249,7 +249,7 @@ const SeqUtils = { } } - return 0; + return a.localeCompare(b); }, }; diff --git a/test/tests/operations/SeqUtils.js b/test/tests/operations/SeqUtils.js index 7fc2c066..52fbaf32 100644 --- a/test/tests/operations/SeqUtils.js +++ b/test/tests/operations/SeqUtils.js @@ -10,8 +10,8 @@ import TestRegister from "../../TestRegister.js"; TestRegister.addTests([ { name: "SeqUtils - Numeric sort photos", - input: "Photo-1.jpg\nPhoto-4.jpg\nPhoto-2.jpg\nPhoto-3.jpg\n", - expectedOutput: "Photo-1.jpg\nPhoto-2.jpg\nPhoto-3.jpg\nPhoto-4.jpg\n", + input: "Photo-1.jpg\nPhoto-4.jpg\nPhoto-2.jpg\nPhoto-3.jpg", + expectedOutput: "Photo-1.jpg\nPhoto-2.jpg\nPhoto-3.jpg\nPhoto-4.jpg", recipeConfig: [ { "op": "Sort",