Skip to content

Commit

Permalink
[inspector] Don't presume all sequential? objects are paged
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Aug 2, 2023
1 parent cf95907 commit 615f61a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/orchard/inspect.clj
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,10 @@
;; possibly infinite
:else Integer/MAX_VALUE))

(declare known-types)

(defn- render-page-info [{:keys [current-page page-size] :as inspector} obj]
(if-not (sequential? obj)
(if-not (#{:coll :array} (known-types inspector obj))
inspector
(let [last-page (last-page inspector obj)
paginate? (not= last-page 0)]
Expand Down
7 changes: 6 additions & 1 deletion test/orchard/inspect_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,12 @@
(:value "\"(0 1 2 3 4 5 6 7 8 9)\"" 1)
(:newline)
(:newline))
(header rendered)))))))
(header rendered)))))

(let [rendered (-> (eduction (range 100)) inspect render)]
(testing "doesn't render page info section"
(is (match? '()
(section "Page Info" rendered)))))))

(deftest tap-current-value
(testing "tap> current value")
Expand Down

0 comments on commit 615f61a

Please sign in to comment.