示例#1
0
 def test_eof(self):
     try:
         ast = sync.parse('synch id (a | b) {')
         assert(1 != 1)
     except exn.ParseError as err:
         self.assertFalse(err.coord)
         self.assertTrue(err.msg == "Syntax error")
示例#2
0
 def test_cond_datamsg_3(self):
     try:
         ast = sync.parse('synch id (a | b) {state int(1) x; start {on: a.(x, y || t){}}}')
         assert(1 != 1)
     except exn.DuplicatesError as err:
         self.assertTrue(err.msg == "'x' was previously declared")
示例#3
0
 def test_state_type_4(self):
     try:
         ast = sync.parse('synch id (a | b) {store ?v.a x; state int(1) x; start {on: a{}}}')
         assert(1 != 1)
     except exn.DuplicatesError as err:
         self.assertTrue(err.msg == "'x' was previously declared")
示例#4
0
 def test_state_type_1(self):
     try:
         ast = sync.parse('synch id (a | b) {state enum(v,b,v) foo; start {on: a{}}}')
         assert(1 != 1)
     except exn.DuplicatesError as err:
         self.assertTrue(err.msg == "'v' was previously declared")
示例#5
0
 def test_decl_store_2(self):
     try:
         ast = sync.parse('synch id (a, b | c) {store ?v.a ma; store ?v.b ma; start {on: a{}}}')
         assert(1 != 1)
     except exn.DuplicatesError as err:
         self.assertTrue(err.msg == "Store variable 'ma' was previously declared")
示例#6
0
 def test_output(self):
     try:
         ast = sync.parse('synch id (a | b, b) {start {on: a{}}}')
         assert(1 != 1)
     except exn.DuplicatesError as err:
         self.assertTrue(err.msg == "Channel 'b' was previously declared")