aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/if/shed.toml9
-rw-r--r--examples/if/src/Counting.shed15
2 files changed, 24 insertions, 0 deletions
diff --git a/examples/if/shed.toml b/examples/if/shed.toml
new file mode 100644
index 00000000..bbbffff5
--- /dev/null
+++ b/examples/if/shed.toml
@@ -0,0 +1,9 @@
+[shed]
+main = "Counting"
+
+[[shed.bins]]
+name = "counting"
+
+[[shed.examples]]
+bin = "counting"
+expected-output = "one\ntwo\nmany"
diff --git a/examples/if/src/Counting.shed b/examples/if/src/Counting.shed
new file mode 100644
index 00000000..060482b5
--- /dev/null
+++ b/examples/if/src/Counting.shed
@@ -0,0 +1,15 @@
+fun message(count: Int) -> String {
+ if (count == 1) {
+ "one\n"
+ } else if (count == 2) {
+ "two\n"
+ } else {
+ "many\n"
+ }
+}
+
+fun main() ! Io -> Unit {
+ print!(message(1));
+ print!(message(2));
+ print!(message(3));
+}