From 61ee63205bc6ff8c61437c7dd77e0d7c9a716ec7 Mon Sep 17 00:00:00 2001 From: vbrazas Date: Wed, 16 Jan 2019 22:19:34 +0200 Subject: [PATCH] test_d01 and test_d02 now working --- unit-tests/test_d01.py | 170 ++++++++++++++++++++--------------------- unit-tests/test_d02.py | 118 ++++++++++++++-------------- 2 files changed, 144 insertions(+), 144 deletions(-) diff --git a/unit-tests/test_d01.py b/unit-tests/test_d01.py index 36be069..28fb77a 100755 --- a/unit-tests/test_d01.py +++ b/unit-tests/test_d01.py @@ -8,18 +8,18 @@ # START OF TESTS START OF TESTS START OF TESTS START OF TESTS # ex00 -test_command(day_location + "ex00/hw.php", "Hello World\n") +test_command('php ' + day_location + "ex00/hw.php", "Hello World\n") print("") # ex01 -# test_command(helpers + "helper_ex01.zsh '" + day_location + "ex01/mlx.php'", "") -test_command(day_location + "ex01/mlx.php", "X" * 1000 + "\n") +# test_command('php ' + helpers + "helper_ex01.zsh '" + day_location + "ex01/mlx.php'", "") +test_command('php ' + day_location + "ex01/mlx.php", "X" * 1000 + "\n") print("") # ex02 at bototm of file # ex03 -test_command(helpers + 'helper_ex03.php ' + day_location \ +test_command('php ' + helpers + 'helper_ex03.php ' + day_location \ + ' "Hello World AAA"' \ + ' " b d w r "' \ + ' " "' \ @@ -62,31 +62,31 @@ print("") # ex04 -test_command(day_location + "ex04/aff_param.php", "") -test_command(day_location + "ex04/aff_param.php toto ahah foo bar quax", """toto +test_command('php ' + day_location + "ex04/aff_param.php", "") +test_command('php ' + day_location + "ex04/aff_param.php toto ahah foo bar quax", """toto ahah foo bar quax """) -test_command(day_location + 'ex04/aff_param.php ""', """ +test_command('php ' + day_location + 'ex04/aff_param.php ""', """ """) -test_command(day_location + 'ex04/aff_param.php "a"', """a +test_command('php ' + day_location + 'ex04/aff_param.php "a"', """a """) print("") # ex05 -test_command(day_location + 'ex05/epur_str.php', "") -test_command(day_location + 'ex05/epur_str.php "Salut, comment ca va ?"', "Salut, comment ca va ?\n") -test_command(day_location + 'ex05/epur_str.php " Hello World "', "Hello World\n") +test_command('php ' + day_location + 'ex05/epur_str.php', "") +test_command('php ' + day_location + 'ex05/epur_str.php "Salut, comment ca va ?"', "Salut, comment ca va ?\n") +test_command('php ' + day_location + 'ex05/epur_str.php " Hello World "', "Hello World\n") print("") # ex06 -test_command(day_location + 'ex06/ssap.php', "") -test_command(day_location + 'ex06/ssap.php foo bar', """bar +test_command('php ' + day_location + 'ex06/ssap.php', "") +test_command('php ' + day_location + 'ex06/ssap.php foo bar', """bar foo """) -test_command(day_location + 'ex06/ssap.php foo bar "yo man" "A moi compte, deux mots" Xibul', """A +test_command('php ' + day_location + 'ex06/ssap.php foo bar "yo man" "A moi compte, deux mots" Xibul', """A Xibul bar compte, @@ -100,31 +100,31 @@ print("") # ex07 -test_command(day_location + 'ex07/rostring.php', "") -test_command(day_location + 'ex07/rostring.php sdfkjsdkl sdkjfskljdf', "sdfkjsdkl\n") -test_command(day_location + 'ex07/rostring.php "hello world aaa" fslkdjf', "world aaa hello\n") -test_command(day_location + 'ex07/rostring.php "a b" fslkdjf', "b a\n") -test_command(day_location + 'ex07/rostring.php "a"', "a\n") -test_command(day_location + 'ex07/rostring.php "c b a"', "b a c\n") -test_command(day_location + 'ex07/rostring.php "a b c d e f g h i j k l"', "b c d e f g h i j k l a\n") +test_command('php ' + day_location + 'ex07/rostring.php', "") +test_command('php ' + day_location + 'ex07/rostring.php sdfkjsdkl sdkjfskljdf', "sdfkjsdkl\n") +test_command('php ' + day_location + 'ex07/rostring.php "hello world aaa" fslkdjf', "world aaa hello\n") +test_command('php ' + day_location + 'ex07/rostring.php "a b" fslkdjf', "b a\n") +test_command('php ' + day_location + 'ex07/rostring.php "a"', "a\n") +test_command('php ' + day_location + 'ex07/rostring.php "c b a"', "b a c\n") +test_command('php ' + day_location + 'ex07/rostring.php "a b c d e f g h i j k l"', "b c d e f g h i j k l a\n") print("") # ex08 -test_command(helpers + 'helper_ex08.php ' + day_location + ' ""', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "" ""', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "c b"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b 1"', "unsorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j j"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j j j j j"', "sorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j i"', "unsorted") -test_command(helpers + 'helper_ex08.php ' + day_location + ' "b a c d e f"', "unsorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' ""', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "" ""', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "c b"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b 1"', "unsorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j j"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j j j j j"', "sorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "a b c d e f g h i j i"', "unsorted") +test_command('php ' + helpers + 'helper_ex08.php ' + day_location + ' "b a c d e f"', "unsorted") print("") -test_command(day_location + 'ex09/ssap2.php', "") -test_command(day_location + 'ex09/ssap2.php toto tutu 4234 "_hop XXX" "##" "1948372 AhAhAh"', """AhAhAh +test_command('php ' + day_location + 'ex09/ssap2.php', "") +test_command('php ' + day_location + 'ex09/ssap2.php toto tutu 4234 "_hop XXX" "##" "1948372 AhAhAh"', """AhAhAh toto tutu XXX @@ -133,75 +133,75 @@ ## _hop """) -test_command(day_location + 'ex09/ssap2.php aaa aaaa', """aaa +test_command('php ' + day_location + 'ex09/ssap2.php aaa aaaa', """aaa aaaa """) -test_command(day_location + 'ex09/ssap2.php "aaa aaaa"', """aaa +test_command('php ' + day_location + 'ex09/ssap2.php "aaa aaaa"', """aaa aaaa """) -test_command(day_location + 'ex09/ssap2.php "hello "', """hello +test_command('php ' + day_location + 'ex09/ssap2.php "hello "', """hello """) -test_command(day_location + 'ex09/ssap2.php "aaaa aaa"', """aaa +test_command('php ' + day_location + 'ex09/ssap2.php "aaaa aaa"', """aaa aaaa """) -test_command(day_location + 'ex09/ssap2.php aaaa aaa', """aaa +test_command('php ' + day_location + 'ex09/ssap2.php aaaa aaa', """aaa aaaa """) # TODO: someone some tests here to test the ord thingy print("") -test_command(day_location + 'ex10/do_op.php', "Incorrect Parameters\n") -test_command(day_location + 'ex10/do_op.php "" "" "" "fourth"', "Incorrect Parameters\n") -test_command(day_location + 'ex10/do_op.php "first" "second"', "Incorrect Parameters\n") -test_command(day_location + 'ex10/do_op.php 1 + 3', "4\n") -test_command(day_location + 'ex10/do_op.php 1 - 3', "-2\n") -test_command(day_location + 'ex10/do_op.php 5 * 3', "15\n") -test_command(day_location + 'ex10/do_op.php 99 * 189274987', "18738223713\n") -test_command(day_location + 'ex10/do_op.php " 1" " *" " 3"', "3\n") -test_command(day_location + 'ex10/do_op.php 42 "% " 3', "0\n") -test_command(day_location + 'ex10/do_op.php " 1 " + 3', "4\n") -test_command(day_location + 'ex10/do_op.php " 5" " * " 3', "15\n") -test_command(day_location + 'ex10/do_op.php "\t5" "*\t" "3\t"', "15\n") -test_command(day_location + 'ex10/do_op.php "5" "*" "\t3"', "15\n") -test_command(day_location + 'ex10/do_op.php "5" "\t*" "3"', "15\n") -test_command(day_location + 'ex10/do_op.php "\t5" "*" "3"', "15\n") -test_command(day_location + 'ex10/do_op.php "\t 5 \t" " \t *\t " "\t3 "', "15\n") -test_command(day_location + 'ex10/do_op.php "-3 \t " " \t * " " -3"', "9\n") -test_command(day_location + 'ex10/do_op.php " 50" "% " " 20"', "10\n") -test_command(day_location + 'ex10/do_op.php "-3 " " *" " -3"', "9\n") -test_command(day_location + 'ex10/do_op.php "-3" "/ " " 2"', "-1.5\n") -test_command(day_location + 'ex10/do_op.php "-3 " "+ " " 5"', "2\n") +test_command('php ' + day_location + 'ex10/do_op.php', "Incorrect Parameters\n") +test_command('php ' + day_location + 'ex10/do_op.php "" "" "" "fourth"', "Incorrect Parameters\n") +test_command('php ' + day_location + 'ex10/do_op.php "first" "second"', "Incorrect Parameters\n") +test_command('php ' + day_location + 'ex10/do_op.php 1 + 3', "4\n") +test_command('php ' + day_location + 'ex10/do_op.php 1 - 3', "-2\n") +test_command('php ' + day_location + 'ex10/do_op.php 5 * 3', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php 99 * 189274987', "18738223713\n") +test_command('php ' + day_location + 'ex10/do_op.php " 1" " *" " 3"', "3\n") +test_command('php ' + day_location + 'ex10/do_op.php 42 "% " 3', "0\n") +test_command('php ' + day_location + 'ex10/do_op.php " 1 " + 3', "4\n") +test_command('php ' + day_location + 'ex10/do_op.php " 5" " * " 3', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "\t5" "*\t" "3\t"', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "5" "*" "\t3"', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "5" "\t*" "3"', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "\t5" "*" "3"', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "\t 5 \t" " \t *\t " "\t3 "', "15\n") +test_command('php ' + day_location + 'ex10/do_op.php "-3 \t " " \t * " " -3"', "9\n") +test_command('php ' + day_location + 'ex10/do_op.php " 50" "% " " 20"', "10\n") +test_command('php ' + day_location + 'ex10/do_op.php "-3 " " *" " -3"', "9\n") +test_command('php ' + day_location + 'ex10/do_op.php "-3" "/ " " 2"', "-1.5\n") +test_command('php ' + day_location + 'ex10/do_op.php "-3 " "+ " " 5"', "2\n") print("") -test_command(day_location + "ex11/do_op_2.php", "Incorrect Parameters\n") -test_command(day_location + "ex11/do_op_2.php first second", "Incorrect Parameters\n") -test_command(day_location + "ex11/do_op_2.php toto", "Syntax Error\n") -test_command(day_location + 'ex11/do_op_2.php "42 * 2" ', "84\n") -test_command(day_location + 'ex11/do_op_2.php "42 / 2" ', "21\n") -test_command(day_location + 'ex11/do_op_2.php "42 % 2" ', "0\n") -test_command(day_location + 'ex11/do_op_2.php "42 % 3" ', "0\n") -test_command(day_location + 'ex11/do_op_2.php "42 - 2" ', "40\n") -test_command(day_location + 'ex11/do_op_2.php "six6*7sept" ', "Syntax Error\n") -test_command(day_location + 'ex11/do_op_2.php "ls -lR /" ', "Syntax Error\n") -test_command(day_location + 'ex11/do_op_2.php "10000 * 20000000" ', "200000000000\n") -test_command(day_location + 'ex11/do_op_2.php "-3 \t \t * -3" ', "9\n") -test_command(day_location + 'ex11/do_op_2.php "50 % 20" ', "10\n") -test_command(day_location + 'ex11/do_op_2.php "-3 * -3" ', "9\n") -test_command(day_location + 'ex11/do_op_2.php "-3 / 2" ', "-1.5\n") -test_command(day_location + 'ex11/do_op_2.php "-3 + 5" ', "2\n") +test_command('php ' + day_location + "ex11/do_op_2.php", "Incorrect Parameters\n") +test_command('php ' + day_location + "ex11/do_op_2.php first second", "Incorrect Parameters\n") +test_command('php ' + day_location + "ex11/do_op_2.php toto", "Syntax Error\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "42 * 2" ', "84\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "42 / 2" ', "21\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "42 % 2" ', "0\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "42 % 3" ', "0\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "42 - 2" ', "40\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "six6*7sept" ', "Syntax Error\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "ls -lR /" ', "Syntax Error\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "10000 * 20000000" ', "200000000000\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "-3 \t \t * -3" ', "9\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "50 % 20" ', "10\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "-3 * -3" ', "9\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "-3 / 2" ', "-1.5\n") +test_command('php ' + day_location + 'ex11/do_op_2.php "-3 + 5" ', "2\n") print("") -test_command(day_location + 'ex12/search_it!.php', "") -test_command(day_location + 'ex12/search_it!.php toto', "") -test_command(day_location + 'ex12/search_it!.php toto "key1:val1" "key2:val2" "toto:42"', "42\n") -test_command(day_location + 'ex12/search_it!.php toto "toto:val1" "key2:val2" "toto:42"', "42\n") -test_command(day_location + 'ex12/search_it!.php "toto" "key1:val1" "key2:val2" "0:hop"', "") -test_command(day_location + 'ex12/search_it!.php "0" "key1:val1" "key2:val2" "0:hop"', "hop\n") +test_command('php ' + day_location + 'ex12/search_it!.php', "") +test_command('php ' + day_location + 'ex12/search_it!.php toto', "") +test_command('php ' + day_location + 'ex12/search_it!.php toto "key1:val1" "key2:val2" "toto:42"', "42\n") +test_command('php ' + day_location + 'ex12/search_it!.php toto "toto:val1" "key2:val2" "toto:42"', "42\n") +test_command('php ' + day_location + 'ex12/search_it!.php "toto" "key1:val1" "key2:val2" "0:hop"', "") +test_command('php ' + day_location + 'ex12/search_it!.php "0" "key1:val1" "key2:val2" "0:hop"', "hop\n") print("") #ex13 -test_command(day_location + 'ex13/agent_stats.php < ' + '' + helpers + 'resources01/peer_notes_1.csv', "") -# test_command(day_location + 'ex13/agent_stats.php < ' + 'average' + helpers + 'resources01/peer_notes_1.csv', "9.8621262458472") +test_command('php ' + day_location + 'ex13/agent_stats.php < ' + '' + helpers + 'resources01/peer_notes_1.csv', "") +# test_command('php ' + day_location + 'ex13/agent_stats.php < ' + 'average' + helpers + 'resources01/peer_notes_1.csv', "9.8621262458472") print("") # END OF TESTS END OF TESTS END OF TESTS END OF TESTS END OF TESTS @@ -227,7 +227,7 @@ Other: C-d to close should exit smoothly""") -# test_command(day_location + 'ex02/oddeven.php < ' + helpers + 'helper_ex02.txt', +# test_command('php ' + day_location + 'ex02/oddeven.php < ' + helpers + 'helper_ex02.txt', # """Enter a number: The number 42 is even # Enter a number: The number 0 is even # Enter a number: The number -0 is even diff --git a/unit-tests/test_d02.py b/unit-tests/test_d02.py index 705f1be..608419a 100755 --- a/unit-tests/test_d02.py +++ b/unit-tests/test_d02.py @@ -2,75 +2,75 @@ from helper import * -day_location = "/Users/vbrazas/projects/php_piscine/d02/" -helpers = "/Users/vbrazas/projects/php_piscine/unit-tests/resources_d02/" +day_location = "/Users/vbrazas/projects/archive/php_piscine/d02/" +helpers = "/Users/vbrazas/projects/archive/php_piscine/unit-tests/resources_d02/" # START OF TESTS START OF TESTS START OF TESTS START OF TESTS # ex00 -test_command(day_location + '/ex00/another_world.php', "") -test_command(day_location + '/ex00/another_world.php ' \ +test_command('php ' + day_location + '/ex00/another_world.php', "") +test_command('php ' + day_location + '/ex00/another_world.php ' \ + '"Cette phrase contient des espaces et des tabulations"' \ , "Cette phrase contient des espaces et des tabulations\n") -test_command(day_location + '/ex00/another_world.php " Ce param est traite " "mais pas celui la"' \ +test_command('php ' + day_location + '/ex00/another_world.php " Ce param est traite " "mais pas celui la"' \ , "Ce param est traite\n") -test_command(day_location + '/ex00/another_world.php "\tCe\tparam \test\t traite\t"', "Ce param est traite\n") -test_command(day_location + '/ex00/another_world.php " Ce\tparam \test\t traite "', "Ce param est traite\n") +test_command('php ' + day_location + '/ex00/another_world.php "\tCe\tparam \test\t traite\t"', "Ce param est traite\n") +test_command('php ' + day_location + '/ex00/another_world.php " Ce\tparam \test\t traite "', "Ce param est traite\n") print("") # ex01 -test_command(day_location + '/ex01/one_more_time.php', "") -test_command(day_location + '/ex01/one_more_time.php "Mercreday 1stJuily 99"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mardi 12 Novembre 2013 12:02:21"' , "1384254141\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:54"', "1360138374\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:53"', "1360138373\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:50"', "1360138370\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:50"', "1360138370\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 13 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 9:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:0:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:5"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 0:0:0"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Wednesday 6 Fevrier 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 February 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Wednesday 6 February 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 012:12:53"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:012:53"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:012"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 02013 09:12:53"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 999 09:12:53"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 99 09:12:53"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mardi 12 Novembre 2013 12:02:21"', "1384254141\n") -test_command(day_location + '/ex01/one_more_time.php "Tuesday 12 Novembre 2013 12:02:21"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Wednesday 13 Novembre 2013 12:02:21"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mardi 12 November 2013 12:02:21"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "samedi 2 novembre 2013 12:02:21"', "1383390141\n") -test_command(day_location + '/ex01/one_more_time.php "jeudi 9 April 2015 12:02:21"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Jeudi 9 Avril 2015 12:02:21"', "1428573741\n") -test_command(day_location + '/ex01/one_more_time.php "Samedi 11 avril 2015 12:02:21"', "1428746541\n") -test_command(day_location + '/ex01/one_more_time.php "samedi 16 novembre 2013 12:02:721"', "Wrong Format\n") - -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 9:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 7 Fevrier 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2014 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 46 Fevrier 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevriers 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredis 6 Fevrier 2013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 -09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:-12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:-50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:501"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:001:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:001"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 001:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 02013 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 20130 09:12:50"', "Wrong Format\n") -test_command(day_location + '/ex01/one_more_time.php "Mercredi -6 Fevrier 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php', "") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercreday 1stJuily 99"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mardi 12 Novembre 2013 12:02:21"' , "1384254141\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:54"', "1360138374\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:53"', "1360138373\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:50"', "1360138370\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:50"', "1360138370\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 13 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 9:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:0:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:5"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 0:0:0"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Wednesday 6 Fevrier 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 February 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Wednesday 6 February 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 012:12:53"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:012:53"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 2013 09:12:012"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 02013 09:12:53"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 999 09:12:53"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 06 Fevrier 99 09:12:53"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mardi 12 Novembre 2013 12:02:21"', "1384254141\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Tuesday 12 Novembre 2013 12:02:21"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Wednesday 13 Novembre 2013 12:02:21"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mardi 12 November 2013 12:02:21"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "samedi 2 novembre 2013 12:02:21"', "1383390141\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "jeudi 9 April 2015 12:02:21"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Jeudi 9 Avril 2015 12:02:21"', "1428573741\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Samedi 11 avril 2015 12:02:21"', "1428746541\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "samedi 16 novembre 2013 12:02:721"', "Wrong Format\n") + +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 9:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 7 Fevrier 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2014 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 46 Fevrier 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevriers 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredis 6 Fevrier 2013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 -09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:-12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:-50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:501"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:001:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 09:12:001"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 2013 001:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 02013 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi 6 Fevrier 20130 09:12:50"', "Wrong Format\n") +test_command('php ' + day_location + '/ex01/one_more_time.php "Mercredi -6 Fevrier 2013 09:12:50"', "Wrong Format\n") print("") # ex02 -test_command(day_location + "/ex02/magnifying_glass.php " + helpers + "page.html", +test_command('php ' + day_location + "/ex02/magnifying_glass.php " + helpers + "page.html", """Nice page Hello World CECI EST UN LIEN
ET CA AUSSI @@ -80,7 +80,7 @@ # ex03 exitcode, out, err = run_command('who') -test_command(day_location + "/ex03/who.php", out) +test_command('php ' + day_location + "/ex03/who.php", out) print("") # ex04 @@ -99,7 +99,7 @@ """) #ex06 -test_command(day_location + "/ex06/srt.php " + helpers + "test.srt", +test_command('php ' + day_location + "/ex06/srt.php " + helpers + "test.srt", """1 00:01:15,308 --> 00:01:16,717 Ceci @@ -116,7 +116,7 @@ 00:01:21,473 --> 00:01:23,614 test """) -test_command(day_location + "/ex06/srt.php " + helpers + "test1.srt", +test_command('php ' + day_location + "/ex06/srt.php " + helpers + "test1.srt", """1 00:01:15,308 --> 00:01:16,717 This @@ -133,7 +133,7 @@ 00:01:21,473 --> 00:01:23,614 test """) -test_command(day_location + "/ex06/srt.php " + helpers + "test2.srt", +test_command('php ' + day_location + "/ex06/srt.php " + helpers + "test2.srt", """1 00:01:15,308 --> 00:01:16,717 This