17 lines
638 B
Nim
17 lines
638 B
Nim
import std/unittest
|
|
|
|
import preserves
|
|
|
|
type AddToStoreClientAttrs {.preservesDictionary.} = object
|
|
## A subset of AddToStoreAttrs
|
|
`ca-method`: Symbol
|
|
eris: seq[byte]
|
|
name: string
|
|
|
|
test "fromPreserve":
|
|
const raw = "{ca: <bind <_>> ca-method: |fixed:r:sha256| deriver: <bind <_>> eris: #[CgA1VVrR0k5gjgU1wKQKVZr1RkANf4zUva3vyc2wmLzhzuL8XqeUL0HE4W3aRpXNwXyFbaLxtXJiLCUWSyLjej+h] name: \"default-builder.sh\" narHash: <bind <_>> narSize: <bind <_>> references: [] registrationTime: <bind <_>> sigs: <bind <_>> ultimate: <bind <_>>}"
|
|
|
|
let pr = parsePreserves(raw)
|
|
var attrs: AddToStoreClientAttrs
|
|
check fromPreserve(attrs, pr)
|