Sha256: 5b0d7b1c4d8a66b210a82feaef5d7986ae51a4b454dca5cdfde8bbeaa7d6cef6

Contents?: true

Size: 976 Bytes

Versions: 100

Compression:

Stored size: 976 Bytes

Contents

(ns flatten-array-test
  (:require [clojure.test :refer [deftest is testing]]
            [flatten-array]))

(deftest flattens-array-of-ints
  (testing "flattens array with just integers present"
    (is (= [1 2 3 4 5 6 7 8]
           (flatten-array/flatten [1 [2 3 4 5 6 7] 8])))))

(deftest five-level-nesting
  (testing "5 level nested list"
    (is (= [0 2 2 3 8 100 4 50 -2]
           (flatten-array/flatten [0 2 [[2 3] 8 100 4 [[[50]]]] -2])))))

(deftest six-level-nesting
  (testing "6 level nested list"
    (is (= [1 2 3 4 5 6 7 8]
           (flatten-array/flatten [1 [2 [[3]] [4 [[5]]] 6 7] 8])))))

(deftest six-level-nested-with-nils
  (testing "6 level nested list with nil values"
    (is (= [0 2 2 3 8 100 -2]
           (flatten-array/flatten [0 2 [[2 3] 8 [[100]] nil [[nil]]] -2])))))

(deftest all-nils-list
  (testing "All values in nested list are nil"
    (is (empty?
          (flatten-array/flatten [nil [[[nil]]] nil nil [[nil nil] nil] nil])))))

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.179 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.178 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.177 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.176 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.175 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.174 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.173 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.172 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.171 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.170 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.169 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.167 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.166 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.165 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.164 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.163 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.162 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.161 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj
trackler-2.2.1.160 tracks/clojure/exercises/flatten-array/test/flatten_array_test.clj