diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-05-29 18:47:20 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-05-29 18:47:20 +0300 |
commit | 35e374cb434166721d26d1b94590b6c88a170607 (patch) | |
tree | 50deaf7115f1c0f9bdd95aba05d05381c7c08efb | |
parent | 7548df306b4ab9d86c61d1fc8cec32b7caeece75 (diff) | |
download | oso-work-sample-35e374cb434166721d26d1b94590b6c88a170607.tar.gz |
test: scenario for list of one
Sponsored-by: author
-rw-r--r-- | README.md | 23 | ||||
-rw-r--r-- | oso.yaml | 7 |
2 files changed, 30 insertions, 0 deletions
@@ -154,10 +154,33 @@ This is very simple computation. Given the server can't assume the list is ordered, it has to compare all list elements to the largest one it has found so far. +# Assumptions + +* The server will abort if the client doesn't use the request id from + the latest server message. That is, the client and server do not + need to handle multiple outstanding comparison requests. + +* The server does not need to handle the case of the client having an + empty list of integers, because there messages as given do no + indicate a way to signal a result of "no result". + +# Find max of a list of one + +This scenario verifies that the server finds the maximum integer in a +list of one. + +~~~scenario +given server +when I run client with list consisting of 1 +then answer is 0 +~~~ + --- title: "OSO work sample—MAX" author: Lars Wirzenius classes: - json +bindings: +- oso.yaml ... diff --git a/oso.yaml b/oso.yaml new file mode 100644 index 0000000..de75d41 --- /dev/null +++ b/oso.yaml @@ -0,0 +1,7 @@ +- given: server + function: start_server + cleanup: stop_server +- when: I run client with list consisting of {items:text} + function: setup_client +- then: answer is {index} + function: answer_is |