#NEWLINE# def test_resumePausedComputationWithResult( self ) : #NEWLINE# #INDENT# self . runtime = Runtime . getMainRuntime ( ) #NEWLINE# vdm = FORANative . VectorDataManager ( callbackScheduler , Setup . config ( ) . maxPageSizeInBytes ) #NEWLINE# context = ExecutionContext . ExecutionContext ( dataManager = vdm , allowInterpreterTracing = False ) #NEWLINE# text = '\n        let f = fun(v, ix) {\n            if (ix > 0)\n                {\n                let (v2,res) = f(v,ix-1);\n                return (v2, res + v2[0])\n                }\n\n            `TriggerInterruptForTesting()\n\n            return (v, 0)\n            };\n\n        f([1], 10)\n        ' #NEWLINE# context . evaluate ( FORA . extractImplValContainer ( FORA . eval ( ( ( 'fun() { ' + text ) + ' }' ) ) ) , FORANative . ImplValContainer ( FORANative . makeSymbol ( 'Call' ) ) ) #NEWLINE# assert context . isInterrupted ( ) #NEWLINE# pausedComp = context . extractPausedComputation ( ) #NEWLINE# framesToUse = pausedComp . frames [ 0 : 5 ] #NEWLINE# pausedComp2 = FORANative . PausedComputation ( framesToUse , FORA . extractImplValContainer ( FORA . eval ( '([2], 0)' , keepAsForaValue = True ) ) , False ) #NEWLINE# context . resumePausedComputation ( pausedComp2 ) #NEWLINE# context . copyValuesOutOfVectorPages ( ) #NEWLINE# context . pageLargeVectorHandles ( 0 ) #NEWLINE# context . resetInterruptState ( ) #NEWLINE# context . resume ( ) #NEWLINE# self . assertTrue ( context . isFinished ( ) ) #NEWLINE# result = context . getFinishedResult ( ) #NEWLINE# self . assertTrue ( ( self . asResult . result [ 1 ] . pyval == 6 ) )