Skip to content

Commit

Permalink
Add test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Shon Feder committed Oct 5, 2023
1 parent 16d7075 commit d8c6cc0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions quint/testFixture/_1043sumTypeDecl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"stage":"parsing","warnings":[],"modules":[{"id":20,"name":"SumTypes","declarations":[{"id":3,"name":"T","kind":"typedef","type":{"id":3,"kind":"sum","fields":{"kind":"row","fields":[{"fieldName":"A","fieldType":{"id":1,"kind":"rec","fields":{"kind":"row","fields":[],"other":{"kind":"empty"}}}},{"fieldName":"B","fieldType":{"id":2,"kind":"int"}}],"other":{"kind":"empty"}}}},{"id":8,"kind":"def","name":"A","qualifier":"val","expr":{"id":7,"kind":"lambda","params":[],"qualifier":"val","expr":{"id":6,"kind":"app","opcode":"variant","args":[{"id":5,"kind":"str","value":"A"},{"id":4,"kind":"app","opcode":"Rec","args":[]}]}}},{"id":14,"kind":"def","name":"B","qualifier":"def","expr":{"id":13,"kind":"lambda","params":[{"id":9,"name":"__BParam"}],"qualifier":"def","expr":{"id":12,"kind":"app","opcode":"variant","args":[{"id":11,"kind":"str","value":"B"},{"kind":"name","name":"__BParam","id":10}]}}},{"id":19,"kind":"def","name":"canConstructVariants","qualifier":"val","expr":{"id":18,"kind":"app","opcode":"List","args":[{"id":15,"kind":"name","name":"A"},{"id":17,"kind":"app","opcode":"B","args":[{"id":16,"kind":"int","value":2}]}]}}]}],"table":{"10":{"id":9,"name":"__BParam","kind":"param"},"15":{"id":8,"kind":"def","name":"A","qualifier":"val","expr":{"id":7,"kind":"lambda","params":[],"qualifier":"val","expr":{"id":6,"kind":"app","opcode":"variant","args":[{"id":5,"kind":"str","value":"A"},{"id":4,"kind":"app","opcode":"Rec","args":[]}]}},"depth":0},"17":{"id":14,"kind":"def","name":"B","qualifier":"def","expr":{"id":13,"kind":"lambda","params":[{"id":9,"name":"__BParam"}],"qualifier":"def","expr":{"id":12,"kind":"app","opcode":"variant","args":[{"id":11,"kind":"str","value":"B"},{"kind":"name","name":"__BParam","id":10}]}},"depth":0}}}
1 change: 1 addition & 0 deletions quint/testFixture/_1043sumTypeDecl.map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sourceIndex":{"0":"mocked_path/testFixture/_1043sumTypeDecl.qnt"},"map":{"1":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"2":[0,{"line":3,"col":8,"index":45},{"line":3,"col":10,"index":47}],"3":[0,{"line":1,"col":2,"index":20},{"line":3,"col":30,"index":48}],"4":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"5":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"6":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"7":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"8":[0,{"line":2,"col":6,"index":35},{"line":2,"col":6,"index":35}],"9":[0,{"line":3,"col":8,"index":45},{"line":3,"col":10,"index":47}],"10":[0,{"line":3,"col":6,"index":43},{"line":3,"col":6,"index":43}],"11":[0,{"line":3,"col":6,"index":43},{"line":3,"col":11,"index":48}],"12":[0,{"line":3,"col":6,"index":43},{"line":3,"col":11,"index":48}],"13":[0,{"line":3,"col":6,"index":43},{"line":3,"col":11,"index":48}],"14":[0,{"line":3,"col":6,"index":43},{"line":3,"col":11,"index":48}],"15":[0,{"line":5,"col":34,"index":85},{"line":5,"col":34,"index":85}],"16":[0,{"line":5,"col":39,"index":90},{"line":5,"col":39,"index":90}],"17":[0,{"line":5,"col":37,"index":88},{"line":5,"col":40,"index":91}],"18":[0,{"line":5,"col":29,"index":80},{"line":5,"col":41,"index":92}],"19":[0,{"line":5,"col":2,"index":53},{"line":5,"col":41,"index":92}],"20":[0,{"line":0,"col":0,"index":0},{"line":6,"col":94,"index":94}]}}
7 changes: 7 additions & 0 deletions quint/testFixture/_1043sumTypeDecl.qnt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module SumTypes {
type T =
| A
| B(int)

val canConstructVariants = List(A, B(2))
}
1 change: 1 addition & 0 deletions quint/testFixture/_1044matchExpression.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"stage":"parsing","warnings":[],"modules":[{"id":37,"name":"SumTypes","declarations":[{"id":4,"name":"T","kind":"typedef","type":{"id":4,"kind":"sum","fields":{"kind":"row","fields":[{"fieldName":"A","fieldType":{"id":1,"kind":"rec","fields":{"kind":"row","fields":[],"other":{"kind":"empty"}}}},{"fieldName":"B","fieldType":{"id":2,"kind":"int"}},{"fieldName":"C","fieldType":{"id":3,"kind":"str"}}],"other":{"kind":"empty"}}}},{"id":9,"kind":"def","name":"A","qualifier":"val","expr":{"id":8,"kind":"lambda","params":[],"qualifier":"val","expr":{"id":7,"kind":"app","opcode":"variant","args":[{"id":6,"kind":"str","value":"A"},{"id":5,"kind":"app","opcode":"Rec","args":[]}]}}},{"id":15,"kind":"def","name":"B","qualifier":"def","expr":{"id":14,"kind":"lambda","params":[{"id":10,"name":"__BParam"}],"qualifier":"def","expr":{"id":13,"kind":"app","opcode":"variant","args":[{"id":12,"kind":"str","value":"B"},{"kind":"name","name":"__BParam","id":11}]}}},{"id":21,"kind":"def","name":"C","qualifier":"def","expr":{"id":20,"kind":"lambda","params":[{"id":16,"name":"__CParam"}],"qualifier":"def","expr":{"id":19,"kind":"app","opcode":"variant","args":[{"id":18,"kind":"str","value":"C"},{"kind":"name","name":"__CParam","id":17}]}}},{"id":24,"kind":"def","name":"c","qualifier":"val","expr":{"id":23,"kind":"app","opcode":"C","args":[{"id":22,"kind":"str","value":"Foo"}]}},{"id":36,"kind":"def","name":"ex","qualifier":"val","expr":{"id":30,"kind":"app","opcode":"match","args":[{"id":25,"kind":"name","name":"c"},{"id":31,"kind":"str","value":"A"},{"id":31,"kind":"lambda","qualifier":"def","expr":{"id":26,"kind":"int","value":0},"params":[{"name":"_","id":32}]},{"id":33,"kind":"str","value":"B"},{"id":33,"kind":"lambda","qualifier":"def","expr":{"id":27,"kind":"name","name":"n"},"params":[{"name":"n","id":34}]},{"id":35,"kind":"str","value":"_"},{"id":35,"kind":"lambda","qualifier":"def","expr":{"id":29,"kind":"app","opcode":"iuminus","args":[{"id":28,"kind":"int","value":1}]},"params":[]}]}}]}],"table":{"11":{"id":10,"name":"__BParam","kind":"param"},"17":{"id":16,"name":"__CParam","kind":"param"},"23":{"id":21,"kind":"def","name":"C","qualifier":"def","expr":{"id":20,"kind":"lambda","params":[{"id":16,"name":"__CParam"}],"qualifier":"def","expr":{"id":19,"kind":"app","opcode":"variant","args":[{"id":18,"kind":"str","value":"C"},{"kind":"name","name":"__CParam","id":17}]}},"depth":0},"25":{"id":24,"kind":"def","name":"c","qualifier":"val","expr":{"id":23,"kind":"app","opcode":"C","args":[{"id":22,"kind":"str","value":"Foo"}]},"depth":0},"27":{"name":"n","id":34,"kind":"param"}}}
1 change: 1 addition & 0 deletions quint/testFixture/_1044matchExpression.map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sourceIndex":{"0":"mocked_path/testFixture/_1044matchExpression.qnt"},"map":{"1":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"2":[0,{"line":1,"col":17,"index":35},{"line":1,"col":19,"index":37}],"3":[0,{"line":1,"col":26,"index":44},{"line":1,"col":28,"index":46}],"4":[0,{"line":1,"col":2,"index":20},{"line":1,"col":29,"index":47}],"5":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"6":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"7":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"8":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"9":[0,{"line":1,"col":11,"index":29},{"line":1,"col":11,"index":29}],"10":[0,{"line":1,"col":17,"index":35},{"line":1,"col":19,"index":37}],"11":[0,{"line":1,"col":15,"index":33},{"line":1,"col":15,"index":33}],"12":[0,{"line":1,"col":15,"index":33},{"line":1,"col":20,"index":38}],"13":[0,{"line":1,"col":15,"index":33},{"line":1,"col":20,"index":38}],"14":[0,{"line":1,"col":15,"index":33},{"line":1,"col":20,"index":38}],"15":[0,{"line":1,"col":15,"index":33},{"line":1,"col":20,"index":38}],"16":[0,{"line":1,"col":26,"index":44},{"line":1,"col":28,"index":46}],"17":[0,{"line":1,"col":24,"index":42},{"line":1,"col":24,"index":42}],"18":[0,{"line":1,"col":24,"index":42},{"line":1,"col":29,"index":47}],"19":[0,{"line":1,"col":24,"index":42},{"line":1,"col":29,"index":47}],"20":[0,{"line":1,"col":24,"index":42},{"line":1,"col":29,"index":47}],"21":[0,{"line":1,"col":24,"index":42},{"line":1,"col":29,"index":47}],"22":[0,{"line":3,"col":12,"index":62},{"line":3,"col":16,"index":66}],"23":[0,{"line":3,"col":10,"index":60},{"line":3,"col":17,"index":67}],"24":[0,{"line":3,"col":2,"index":52},{"line":3,"col":17,"index":67}],"25":[0,{"line":5,"col":17,"index":87},{"line":5,"col":17,"index":87}],"26":[0,{"line":6,"col":14,"index":105},{"line":6,"col":14,"index":105}],"27":[0,{"line":7,"col":14,"index":121},{"line":7,"col":14,"index":121}],"28":[0,{"line":8,"col":15,"index":138},{"line":8,"col":15,"index":138}],"29":[0,{"line":8,"col":14,"index":137},{"line":8,"col":15,"index":138}],"30":[0,{"line":5,"col":11,"index":81},{"line":9,"col":72,"index":142}],"31":[0,{"line":6,"col":6,"index":97},{"line":6,"col":14,"index":105}],"32":[0,{"line":6,"col":6,"index":97},{"line":6,"col":6,"index":97}],"33":[0,{"line":7,"col":6,"index":113},{"line":7,"col":14,"index":121}],"34":[0,{"line":7,"col":6,"index":113},{"line":7,"col":9,"index":116}],"35":[0,{"line":8,"col":6,"index":129},{"line":8,"col":15,"index":138}],"36":[0,{"line":5,"col":2,"index":72},{"line":9,"col":72,"index":142}],"37":[0,{"line":0,"col":0,"index":0},{"line":10,"col":144,"index":144}]}}
11 changes: 11 additions & 0 deletions quint/testFixture/_1044matchExpression.qnt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module SumTypes {
type T = A | B(int) | C(str)

val c = C("Foo")

val ex = match c {
| A => 0
| B(n) => n
| _ => -1
}
}

0 comments on commit d8c6cc0

Please sign in to comment.