fixup test

This commit is contained in:
Sam Caldwell 2020-03-11 13:12:16 -04:00
parent 5c8986bddd
commit a2780484be
4 changed files with 21 additions and 9 deletions

View File

@ -3,3 +3,8 @@
(define racket-launcher-names '("syndicate-broker" "syndicate-render-msd"))
(define racket-launcher-libraries '("broker/server.rkt" "trace/render-msd.rkt"))
(define test-include-paths '("syndicate/tests"))
(define test-omit-paths
'(;; Sam: example-plain is interactive, I think
"examples/example-plain.rkt"
;; Sam: for whatever reason I get a failure to load libcrypto for f-to-c
"examples/actor/f-to-c.rkt"))

View File

@ -1,7 +1,8 @@
#lang syndicate/test
;; Reflects the current behavior of the little implementation,
;; but quite possibly *not* what should happen
;; The facet in the on-stop should immediately die and its assertion should never be visible.
;; Pretty sure the little implementation gets that wrong.
;; the trace does not have a way of saying there should never be a "here" assertion
(spawn
(on-stop (react (assert (outbound "here"))))
@ -9,4 +10,4 @@
(spawn (on-start (send! "stop")))
(trace (assertion-added (outbound "here")))
(trace (message "stop"))

View File

@ -5,6 +5,10 @@
;; dubious behavior by little implementation;
;; create new facets from more nested facets
;; The facet in the on-stop should immediately die and its assertion should never be visible.
;; Pretty sure the little implementation gets that wrong.
;; the trace does not have a way of saying there should never be an "inner" assertion
(spawn (on-start
(react (on-stop
(react (assert (outbound "inner"))))))
@ -13,4 +17,4 @@
(spawn (on-start (send! "stop")))
(trace (assertion-added (outbound "inner")))
(trace (message "stop"))

View File

@ -77,11 +77,13 @@
(start-facet x
(on (retracted (observe (quote title discard)))
(stop x))
(match title
["Catch 22"
(assert (quote title (price 22)))]
[discard
(assert (quote title (out-of-stock)))])))
(define answer
(match title
["Catch 22"
(price 22)]
[_
(out-of-stock)]))
(assert (quote title answer))))
(on (asserted (observe (order (bind title String) (bind offer Int) discard discard)))
(start-facet x
(on (retracted (observe (order title offer discard discard)))