11import unittest
22from judge import run
33
4+ #test for Java program
45class TestRunA (unittest .TestCase ):
56 def test_run (self ):
67 program_name = "testfiles/" + "test_java.java"
@@ -9,7 +10,7 @@ def test_run(self):
910 self .assertEqual (run (program_name , language , output ),
1011 "Accepted" , "Something Wrong" )
1112
12-
13+ #test for Python program
1314class TestRunB (unittest .TestCase ):
1415 def test_run (self ):
1516 program_name = "testfiles/" + "test_python.py"
@@ -18,6 +19,25 @@ def test_run(self):
1819 Input = "testfiles/" + "input.txt"
1920 self .assertEqual (run (program_name , language , output , Input ),
2021 "Accepted" , "Something Wrong" )
22+ #test for C program
23+ class TestRunC (unittest .TestCase ):
24+ def test_run (self ):
25+ program_name = "testfiles/" + "test_c.c"
26+ language = "C"
27+ output = "testfiles/" + "output3.txt"
28+ Input = "testfiles/" + "input2.txt"
29+ self .assertEqual (run (program_name , language , output , Input ),
30+ "Accepted" , "Something Wrong" )
31+
32+ #test for C++ program
33+ class TestRunD (unittest .TestCase ):
34+ def test_run (self ):
35+ program_name = "testfiles/" + "test_c++.cpp"
36+ language = "C++"
37+ output = "testfiles/" + "output4.txt"
38+ Input = "testfiles/" + "input3.txt"
39+ self .assertEqual (run (program_name , language , output , Input ),
40+ "Accepted" , "Something Wrong" )
2141
2242
2343if __name__ == '__main__' :
0 commit comments