aboutsummaryrefslogtreecommitdiff
;; Run with
;;
;;   guile -L  . --debug test/runner.scm

(define-module (test-runner)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-64)
  #:use-module (gn data species)
  )

(test-begin "runner")

(test-equal "species short names"
  (get-species-shortnames (get-species)) #f)

(test-equal "species binominal identifiers"
  (get-species-binominal-names (get-species)) '("Solanum_lycopersicum" "Rattus_norvegicus" "Populus_trichocarpa" "Mus_musculus" "Hordeum_vulgare" "Homo_sapiens" "Glycine_max" "Arabidopsis_thaliana" "Oryzias_latipes" "Macaca_nemestrina" "Glossophaga_soricina" "Drosophila_melanogaster"))

(test-assert "species-meta is expected contain a link to tomato"
  (assoc "tomato" (cdr (assoc "links" (get-species-meta)))))

(test-assert "tomato-meta should have a document link"
   (assoc "doc" (get-expanded-taxon-meta "tomato")))

(test-equal "tomato-data should have a description"
  (assoc-ref (get-expanded-taxon-data "tomato") "description") "type of plant species with edible, often red, berry fruit")

(test-assert "mouse-meta should list all groups/populations/cohorts"
  (assoc "links" (get-expanded-taxon-meta "mouse")))

(test-end "runner")