From 35e374cb434166721d26d1b94590b6c88a170607 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 29 May 2021 18:47:20 +0300 Subject: test: scenario for list of one Sponsored-by: author --- README.md | 23 +++++++++++++++++++++++ oso.yaml | 7 +++++++ 2 files changed, 30 insertions(+) create mode 100644 oso.yaml diff --git a/README.md b/README.md index 0d5e25b..94615e3 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.1