Coverage report: /home/runner/work/geb/geb/test/bitc.lisp
Kind | Covered | All | % |
expression | 113 | 146 | 77.4 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
3
(define-test geb-bitc :parent geb-test-suite)
6
(bitc:compose (bitc:branch
7
(bitc:parallel (bitc:compose (bitc:parallel bitc:zero
11
(bitc:parallel (bitc:parallel (bitc:ident 1)
14
(bitc:parallel (bitc:swap 1 1)
18
(to-circuit bitc-circuit-1 :tc_1))
20
(define-test vampir-converter
22
(of-type list test-circuit-1))
24
(define-test bitc-evaluates-and-correctly
26
(is equalp #*1 (gapply (to-bitc geb-bool:and) #*11))
27
(is equalp #*0 (gapply (to-bitc geb-bool:and) #*10))
28
(is equalp #*0 (gapply (to-bitc geb-bool:and) #*01))
29
(is equalp #*0 (gapply (to-bitc geb-bool:and) #*00)))
31
(define-test bitc-swap-evaluation
33
(is equalp #*011 (gapply (bitc:swap 0 3) #*011))
34
(is equalp #*011 (gapply (bitc:swap 3 0) #*011))
35
(is equalp #*101 (gapply (bitc:swap 2 1) #*011))
36
(is equalp #*110 (gapply (bitc:swap 2 1) #*101))
37
(is equalp #*011 (gapply (bitc:swap 2 1) #*110))
38
(is equalp #*01011 (gapply (bitc:swap 2 3) #*11010))
39
(is equalp #*100110 (gapply (bitc:swap 3 3) #*110100)))
41
(define-test bitc-full-evaluation-tests
46
(gapply (bitc:parallel (bitc:swap 2 1)
50
(is equalp #*0101 (gapply (bitc:fork 2) #*01))
55
(bitc:parallel (bitc:swap 1 1) ; bool not
56
(bitc:ident 2)) ; bool id
62
(gapply (bitc:parallel (bitc:drop 1) (bitc:ident 1))
64
;; and now branch it! also testing one and zero
65
(is equalp #*1 (gapply (bitc:branch bitc:one bitc:zero) #*01))
66
(is equalp #*0 (gapply (bitc:branch bitc:one bitc:zero) #*11)))