<< Back to previous view

[TCHECK-62] ClojureScript example in README doesn't work Created: 23/Mar/15  Updated: 23/Mar/15

Status: Open
Project: test.check
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Branislav Hašto Assignee: Reid Draper
Resolution: Unresolved Votes: 0
Labels: None
Environment:

[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-3126"]
[org.clojure/test.check "0.7.0"]



 Description   

ClojureScript example in README doesn't seem to work:

(ns hello.core
    (:require [cljs.test.check :as tc]
              [cljs.test.check.generators :as gen]
              [cljs.test.check.properties :as prop]))

(def sort-idempotent-prop
  (prop/for-all [v (gen/vector gen/int)]
    (= (sort v) (sort (sort v)))))

(tc/quick-check 100 sort-idempotent-prop)

Compilation gives these warnings:
WARNING: Use of undeclared Var cljs.test.check.properties/for-all at line 7 src/hello/core.cljs
WARNING: Use of undeclared Var hello.core/v at line 7 src/hello/core.cljs
WARNING: Use of undeclared Var hello.core/v at line 8 src/hello/core.cljs
WARNING: Use of undeclared Var hello.core/v at line 8 src/hello/core.cljs

When I change the namespace declaration to include [cljs.test.check.properties :as prop :include-macros true] it seems to work fine.

I am beginner in ClojureScript so if this is some special example that works in cljs.user but doesn't work in custom namespace, then I'm sorry (I tried to search first).






Generated at Sat Mar 28 23:23:54 CDT 2015 using JIRA 4.4#649-r158309.