jgrodziski / talltale

A Clojure/ClojureScript Fake Data Generator Library
Eclipse Public License 1.0
70 stars 4 forks source link

`company-gen` works incorrectly #26

Closed raszi closed 3 months ago

raszi commented 3 months ago

The company-gen uses a name and type that is not defined as an argument, therefore it falls back to the clojure.core/name and clojure.core/type which are functions:

https://github.com/jgrodziski/talltale/blob/80bf1868d2c3ad5c95cb0c797e02d99beb854d72/src/talltale/core.cljc#L392-L408

Therefore the generated data is incorrect:

(clojure.spec.gen.alpha/generate (talltale.core/company-gen))

returns:

  :address = {:street "Washington Walk", :street-number 502, :postal-code "94394", :city "New York"}
  :email = "info@clojure.core$name@38525c6e.com"
  :phone-number = "654-837-101"
  :company-name = "Furba"
  :company-id = "clojure.core$name@38525c6e"
  :url = "https://www.clojure.core$name@38525c6e.com"
  :full-name = "clojure.core$name@38525c6e clojure.core$type@759d9de"
  :tld = "com"
  :logo-url = "http://via.placeholder.com/350x150?text=clojure.core$name@38525c6e"
  :identification-number = "80-0001915"
  :domain = "clojure.core$name@38525c6e.com"
  :company-type = "Ltd"
raszi commented 3 months ago

Sorry, the latest commit still has this issue. It seems to be a regression introduced in c4285184fc471c6a09115d40eb389742cb4daa27