#NEWLINE# def test_extractPausedComputation( self ) : #NEWLINE# #INDENT# text = 'fun() {\n            let x = 0;\n            while (x < 100000)\n                x = x + 1\n            x\n            }' #NEWLINE# self . runtime = Runtime . getMainRuntime ( ) #NEWLINE# vdm = FORANative . VectorDataManager ( callbackScheduler , Setup . config ( ) . maxPageSizeInBytes ) #NEWLINE# context = ExecutionContext . ExecutionContext ( dataManager = vdm , allowInterpreterTracing = False ) #NEWLINE# context . interruptAfterCycleCount ( 1010 ) #NEWLINE# context . evaluate ( FORA . extractImplValContainer ( FORA . eval ( text ) ) , FORANative . symbol_Call ) #NEWLINE# computation = context . extractPausedComputation ( ) #NEWLINE# self . assertEqual ( len ( computation . frames ) , 2 ) #NEWLINE# self . assertEqual ( computation . frames [ 1 ] . values [ 0 ] . pyval , 335 ) #NEWLINE# context2 = ExecutionContext . ExecutionContext ( dataManager = vdm , allowInterpreterTracing = False ) #NEWLINE# context2 . resumePausedComputation ( computation ) #NEWLINE# context2 . resume ( ) #NEWLINE# self . assertEqual ( context2 . getFinishedResult ( ) . asResult . result . pyval , 100000 ) #NEWLINE# context . teardown ( ) #NEWLINE# context2 . teardown ( )