syndicate-rkt/OLD-syndicate/test/core/during-criterion-snapshotti...

21 lines
759 B
Racket

;;; SPDX-License-Identifier: LGPL-3.0-or-later
;;; SPDX-FileCopyrightText: Copyright © 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
#lang syndicate/test-implementation
;; See .../syndicate/examples/actor/example-during-criterion-shapshotting.rkt
(test-case
[(struct foo (x y) #:prefab)
(spawn (field [x 123])
(assert (foo (x) 999))
(during (foo (x) $v)
(define x0 (x))
(printf "x=~a v=~a\n" (x) v)
(when (= (x) 123) (x 124))
(on-stop
(printf "finally for x0=~a x=~a v=~a\n" x0 (x) v))))]
no-crashes
(expected-output (list "x=123 v=999"
"x=124 v=999"
"finally for x0=123 x=124 v=999")))