Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn catching-test [selector]
- (try
- (text selector)
- (catch NoSuchElementException e
- nil)))
- (defn when-let-test [selector]
- (when-let [item (element selector)]
- (text item)))
- (defn nil-test [selector]
- (text selector)) ;; won't work in the current codebase.
- (defn testing [selector]
- (let [catchex (catching-test selector)
- whenex (when-let-test selector)
- niltest (nil-test selector)]
- (cond-> {}
- catchex (assoc :catching-test catchex)
- whenex (assoc :when-let-test whenex)
- niltest (assoc :nil-test niltest))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement