File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,10 @@ class StringVal(val.ExtensionValue):
22
22
23
23
def to_value (self ) -> val .Extension :
24
24
name = "ConstString"
25
- payload = {"value" : self .v }
26
25
return val .Extension (
27
26
name ,
28
27
typ = STRING_T ,
29
- val = payload ,
28
+ val = self . v ,
30
29
)
31
30
32
31
def __str__ (self ) -> str :
Original file line number Diff line number Diff line change
1
+ from hugr .build .dfg import Dfg
1
2
from hugr .std .prelude import STRING_T , StringVal
2
3
4
+ from .conftest import validate
5
+
3
6
4
7
def test_string_val ():
5
- ext_val = StringVal ("test" ).to_value ()
8
+ val = StringVal ("test" )
9
+ ext_val = val .to_value ()
6
10
assert ext_val .name == "ConstString"
7
11
assert ext_val .typ == STRING_T
8
- assert ext_val .val == {"value" : "test" }
12
+ assert ext_val .val == "test"
13
+
14
+ dfg = Dfg ()
15
+ v = dfg .load (val )
16
+ dfg .set_outputs (v )
17
+
18
+ validate (dfg .hugr )
You can’t perform that action at this time.
0 commit comments