summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-29 18:47:20 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-29 18:47:20 +0300
commit35e374cb434166721d26d1b94590b6c88a170607 (patch)
tree50deaf7115f1c0f9bdd95aba05d05381c7c08efb
parent7548df306b4ab9d86c61d1fc8cec32b7caeece75 (diff)
downloadoso-work-sample-35e374cb434166721d26d1b94590b6c88a170607.tar.gz
test: scenario for list of one
Sponsored-by: author
-rw-r--r--README.md23
-rw-r--r--oso.yaml7
2 files changed, 30 insertions, 0 deletions
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&mdash;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