aboutsummaryrefslogtreecommitdiff
path: root/test/runner.scm
blob: da42235bec830c88ab9c76174a31a8bb4508d12a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;; 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")