Merge pull request #265 from mkfifo/array-ne

Array ne
This commit is contained in:
Erik Svedäng 2018-06-26 10:20:21 +02:00 committed by GitHub
commit e741d59ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -28,6 +28,9 @@
(break))))
eq)))
(defn /= [a b]
(not (= a b)))
(doc maximum "Get the maximum in an array (elements must support <).")
(defn maximum [xs]
(let [result (first xs)

File diff suppressed because one or more lines are too long

View File

@ -22,13 +22,19 @@
(with-test test
(assert-true test
(= &[1 2 3] &[1 2 3])
"= works as expected")
"= works as expected I")
(assert-false test
(= &[1 2 3] &[1 2 3 4])
"= works as expected")
"= works as expected II")
(assert-false test
(= &[1 2 3] &[1 2 34])
"= works as expected")
"= works as expected III")
(assert-true test
(/= &[1 2 3] &[1 2 3 4])
"/= works as expected I")
(assert-true test
(/= &[1 2 4] &[1 2 3])
"/= works as expected II")
(assert-equal test
&[0 0 0 0]
&(replicate 4 &0)