diff options
author | 2015-10-07 14:43:49 +0200 | |
---|---|---|
committer | 2015-10-07 14:47:55 +0200 | |
commit | 27492a7674587e1a3372cd7545e056e2775c69b3 (patch) | |
tree | 7d1267ac043e7cb670371f82bd97f5be811f4e29 | |
parent | 8a7f111ad5ce35e183016a2a968d19f29b7622c5 (diff) |
Test for record syntax parsing.
-rw-r--r-- | test-suite/success/record_syntax.v | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test-suite/success/record_syntax.v b/test-suite/success/record_syntax.v new file mode 100644 index 000000000..db2bbb0dc --- /dev/null +++ b/test-suite/success/record_syntax.v @@ -0,0 +1,47 @@ +Module A. + +Record Foo := { foo : unit; bar : unit }. + +Definition foo_ := {| + foo := tt; + bar := tt +|}. + +Definition foo0 (p : Foo) := match p with {| |} => tt end. +Definition foo1 (p : Foo) := match p with {| foo := f |} => f end. +Definition foo2 (p : Foo) := match p with {| foo := f; |} => f end. +Definition foo3 (p : Foo) := match p with {| foo := f; bar := g |} => (f, g) end. +Definition foo4 (p : Foo) := match p with {| foo := f; bar := g; |} => (f, g) end. + +End A. + +Module B. + +Record Foo := { }. + +End B. + +Module C. + +Record Foo := { foo : unit; bar : unit; }. + +Definition foo_ := {| + foo := tt; + bar := tt; +|}. + +End C. + +Module D. + +Record Foo := { foo : unit }. +Definition foo_ := {| foo := tt |}. + +End D. + +Module E. + +Record Foo := { foo : unit; }. +Definition foo_ := {| foo := tt; |}. + +End E. |