From 48fb3e197aec2ec14cdc83c7e350fad64fe72ca6 Mon Sep 17 00:00:00 2001 From: Bram Pouwelse Date: Thu, 29 Oct 2015 12:02:09 +0100 Subject: [PATCH] lodash: moved _.sortedIndex test into TestSortedIndex module --- lodash/lodash-tests.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..9b1698871 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -699,17 +699,20 @@ module TestRest { result = _(testSliceArray).slice(42, 42).value(); } -result = _.sortedIndex([20, 30, 50], 40); -result = _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); -var sortedIndexDict: { wordToNumber: { [idx: string]: number } } = { - 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } -}; -result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { - return sortedIndexDict.wordToNumber[word]; -}); -result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { - return this.wordToNumber[word]; -}, sortedIndexDict); +// _.sortedIndex +module TestSortedIndex { + result = _.sortedIndex([20, 30, 50], 40); + result = _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + var sortedIndexDict: { wordToNumber: { [idx: string]: number } } = { + 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + }; + result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { + return sortedIndexDict.wordToNumber[word]; + }); + result = _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function (word: string) { + return this.wordToNumber[word]; + }, sortedIndexDict); +} // _.tail module TestTail {