From 508cada017cdd6829a9ed00d51d8864c374e2217 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 17 Aug 2013 08:15:42 -0700 Subject: [PATCH] Add string test for `_.shuffle`. Former-commit-id: 420789264a287b5431322b9871a3c1c219ff2722 --- test/test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test.js b/test/test.js index 4711200eb..b59df6bc9 100644 --- a/test/test.js +++ b/test/test.js @@ -3323,6 +3323,17 @@ var actual = _.shuffle({ 'a': 1, 'b': 2, 'c': 3 }); deepEqual(actual.sort(), [1, 2, 3]); }); + + _.forEach({ + 'literal': 'abc', + 'object': Object('abc') + }, + function(collection, key) { + test('should work with a string ' + key + ' for `collection`', function() { + var actual = _.shuffle(collection); + deepEqual(actual.sort(), ['a','b', 'c']); + }); + }); }()); /*--------------------------------------------------------------------------*/