def test_commands_generation_for_go(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.go', 'mdl', 'go') self.assertEqual(comp_cmd, 'go build -o mdl mdl.go') self.assertEqual(exec_cmd, './mdl')
def test_commands_generation_for_c(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.c', 'mdl', 'c') self.assertEqual(comp_cmd, 'gcc mdl.c -lm -o mdl') self.assertEqual(exec_cmd, './mdl')
def test_commands_generation_for_js(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.js', 'mdl', 'js') self.assertEqual(comp_cmd, None) self.assertEqual(exec_cmd, 'node mdl.js')
def test_commands_generation_for_java(self): comp_cmd, exec_cmd = Porter._get_commands('Mdl.java', 'Mdl', 'java') self.assertEqual(comp_cmd, 'javac Mdl.java') self.assertEqual(exec_cmd, 'java -classpath . Mdl')
def test_commands_generation_for_php(self): comp_cmd, exec_cmd = Porter._get_commands('Mdl.php', 'Mdl', 'php') self.assertEqual(comp_cmd, None) self.assertEqual(exec_cmd, 'php -f Mdl.php')
def test_commands_generation_for_go(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.go', 'mdl', 'go') self.assertEqual(comp_cmd, 'go build -o mdl mdl.go') self.assertEqual(exec_cmd, './mdl')
def test_commands_generation_for_js(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.js', 'mdl', 'js') self.assertEqual(comp_cmd, None) self.assertEqual(exec_cmd, 'node mdl.js')
def test_commands_generation_for_c(self): comp_cmd, exec_cmd = Porter._get_commands('mdl.c', 'mdl', 'c') self.assertEqual(comp_cmd, 'gcc mdl.c -lm -o mdl') self.assertEqual(exec_cmd, './mdl')
def test_commands_generation_for_php(self): comp_cmd, exec_cmd = Porter._get_commands('Mdl.php', 'Mdl', 'php') self.assertEqual(comp_cmd, None) self.assertEqual(exec_cmd, 'php -f Mdl.php')
def test_commands_generation_for_java(self): comp_cmd, exec_cmd = Porter._get_commands('Mdl.java', 'Mdl', 'java') self.assertEqual(comp_cmd, 'javac Mdl.java') self.assertEqual(exec_cmd, 'java -classpath . Mdl')