-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckerSuiteone.py
33 lines (32 loc) · 1.22 KB
/
CheckerSuiteone.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import unittest
from TestUtils import TestChecker
from AST import *
from Visitor import Visitor
from StaticError import *
from abc import ABC
class CheckerSuite(unittest.TestCase):
# def test_basicArrayLit(self):
# """Test basicUndeclared_Identifier_Param"""
# input = Program([
# VarDecl("x", ArrayType([3], FloatType()),ArrayLit([FloatLit(1), IntegerLit(2), UnExpr("-",IntegerLit(4))]))])
# # """
# # bds: function integer () {
# # return a;
# # }
# # main: function void () {
# # }"""
# expect = "No entry point"
# self.assertTrue(TestChecker.test(input, expect, 409))
def test_jump144(self):
input = """
main: function void() {
a: auto = {1, 2};
a[f1(1,2,3)] = 2;
x: string = true;
}
f1: function auto(x: float, y: float, z: float) {
return x + y + z;
}
"""
expect = """Type mismatch in Variable Declaration: VarDecl(x, StringType, BooleanLit(True))"""
self.assertTrue(TestChecker.test(input, expect, 144))