aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/util/graph.scm
blob: 43690fb5a850b337bae8b07a6fb158e4ddd5b9c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(define-module (test hnh-util-graph)
  :use-module (srfi srfi-64)
  :use-module (srfi srfi-88)
  :use-module ((hnh util) :select (->))
  :use-module (hnh util graph)
  )

(define g (make-graph string->symbol
                      string=?))

(test-assert "New graphs are empty" (graph-empty? g))

(let ((g2 (-> g
              (add-node "a" '())
              (add-node "b" '(a)))))
  (test-assert "Changing graph doesn't change source graph"
    (graph-empty? g))

  (test-equal '("a" "b")
   (resolve-dependency-graph g2)))

'((hnh util graph))