[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
pmb2
/
assets
/
tinymce
/
src
/
core
/
src
/
test
/
js
/
atomic
/
util
/
[
Home
]
File: LazyEvaluatorTest.js
asynctest( 'atomic.tinymce.core.util.LazyEvaluatorTest', [ 'ephox.agar.api.Assertions', 'ephox.agar.api.Pipeline', 'ephox.agar.api.Step', 'ephox.katamari.api.Option', 'tinymce.core.util.LazyEvaluator' ], function (Assertions, Pipeline, Step, Option, LazyEvaluator) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var sTestEvaluateUntil = Step.sync(function () { var operations = [ function (a, b) { return a === 1 && b === 'a' ? Option.some(1) : Option.none(); }, function (a, b) { return a === 2 && b === 'b' ? Option.some(2) : Option.none(); }, function (a, b) { return a === 3 && b === 'c' ? Option.some(3) : Option.none(); } ]; Assertions.assertEq('Should return none', true, LazyEvaluator.evaluateUntil(operations, [123, 'x']).isNone()); Assertions.assertEq('Should return first item', 1, LazyEvaluator.evaluateUntil(operations, [1, 'a']).getOrDie(1)); Assertions.assertEq('Should return second item', 2, LazyEvaluator.evaluateUntil(operations, [2, 'b']).getOrDie(2)); Assertions.assertEq('Should return third item', 3, LazyEvaluator.evaluateUntil(operations, [3, 'c']).getOrDie(3)); }); Pipeline.async({}, [ sTestEvaluateUntil ], function () { success(); }, failure); } );