Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions hugr-core/tests/snapshots/model__roundtrip_call.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,49 @@ expression: ast
(declare-func
public
example.callee
(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])
(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])
(meta (compat.meta_json "description" "\"This is a function declaration.\""))
(meta (compat.meta_json "title" "\"Callee\"")))

(define-func
public
example.caller
(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])
(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])
(meta
(compat.meta_json
"description"
"\"This defines a function that calls the function which we declared earlier.\""))
(meta (compat.meta_json "title" "\"Caller\""))
(dfg [%0] [%1]
(signature (core.fn [arithmetic.int.types.int] [arithmetic.int.types.int]))
(signature
(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)]))
((core.call
[arithmetic.int.types.int]
[arithmetic.int.types.int]
[(arithmetic.int.types.int 5)]
[(arithmetic.int.types.int 5)]
example.callee)
[%0] [%1]
(signature
(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])))))
(core.fn
[(arithmetic.int.types.int 5)]
[(arithmetic.int.types.int 5)])))))

(define-func
public
example.load
(core.fn [] [(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])])
(core.fn
[]
[(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])])
(dfg [] [%0]
(signature
(core.fn
[]
[(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])]))
[(core.fn
[(arithmetic.int.types.int 5)]
[(arithmetic.int.types.int 5)])]))
((core.load_const example.caller) [] [%0]
(signature
(core.fn
[]
[(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])])))))
[(core.fn
[(arithmetic.int.types.int 5)]
[(arithmetic.int.types.int 5)])])))))
12 changes: 6 additions & 6 deletions hugr-model/tests/fixtures/model-call.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

(declare-func public
example.callee
(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])
(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])
(meta (compat.meta_json "title" "\"Callee\""))
(meta (compat.meta_json "description" "\"This is a function declaration.\"")))

(define-func public example.caller
(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])
(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])
(meta (compat.meta_json "title" "\"Caller\""))
(meta (compat.meta_json "description" "\"This defines a function that calls the function which we declared earlier.\""))
(dfg [%3] [%4]
(signature (core.fn [arithmetic.int.types.int] [arithmetic.int.types.int]))
(signature (core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)]))
((core.call _ _ example.callee) [%3] [%4]
(signature (core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])))))
(signature (core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])))))

(define-func public
example.load
(core.fn [] [(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])])
(core.fn [] [(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])])
(dfg
[]
[%5]
(signature (core.fn [] [(core.fn [arithmetic.int.types.int] [arithmetic.int.types.int])]))
(signature (core.fn [] [(core.fn [(arithmetic.int.types.int 5)] [(arithmetic.int.types.int 5)])]))
((core.load_const _ example.caller) [] [%5])))
Loading