We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6005588 commit 4002758Copy full SHA for 4002758
test/1_stdlib/Algorithm.swift
@@ -0,0 +1,27 @@
1
+// RUN: %target-run-simple-swift
2
+// REQUIRES: executable_test
3
+
4
+import StdlibUnittest
5
+import Swift
6
7
+let AlgorithmTests = TestSuite("Algorithm")
8
9
+AlgorithmTests.test("Min") {
10
+ expectEqual(0, min(0, 1))
11
+ expectEqual(0, min(1, 0))
12
13
+ expectEqual(0, min(0, 1, 1))
14
+ expectEqual(0, min(1, 0, 1))
15
+ expectEqual(0, min(1, 1, 0))
16
+}
17
18
+AlgorithmTests.test("Max") {
19
+ expectEqual(1, max(1, 0))
20
+ expectEqual(1, max(0, 1))
21
22
+ expectEqual(1, max(1, 0, 0))
23
+ expectEqual(1, max(0, 1, 0))
24
+ expectEqual(1, max(0, 0, 1))
25
26
27
+runAllTests()
0 commit comments