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