From c20e9e2d43cce1993df295098a6b16e7ffba6d48 Mon Sep 17 00:00:00 2001 From: Oskar Date: Fri, 19 Apr 2024 15:47:37 +0200 Subject: moved testcases and made new testcases --- TODO | 1 - test/oldtests/i_validation_cases.txt | 177 ++++++++++++++++++++++++++++++++++ test/oldtests/smode_cases.txt | 31 ++++++ test/oldtests/smode_cases2.txt | 118 +++++++++++++++++++++++ test/testcases/i_validation_cases.txt | 177 ---------------------------------- test/testcases/smode_cases.txt | 31 ------ test/testcases/smode_cases2.txt | 118 ----------------------- test/testcases/version2cases.txt | 8 ++ 8 files changed, 334 insertions(+), 327 deletions(-) create mode 100644 test/oldtests/i_validation_cases.txt create mode 100644 test/oldtests/smode_cases.txt create mode 100644 test/oldtests/smode_cases2.txt delete mode 100644 test/testcases/i_validation_cases.txt delete mode 100644 test/testcases/smode_cases.txt delete mode 100644 test/testcases/smode_cases2.txt create mode 100644 test/testcases/version2cases.txt diff --git a/TODO b/TODO index 313e77a..e4785b5 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ TODO list. This is mostly so i can plan more granularly and remember small stuff This is not my overall big planning board. (1 highest prio, 10 lowest) 1 - Perform full test of the whole program. -2 - Re-write Makefile to make it easier 2 - Add some quality of life features 3 - Re-write new_line and remove_line_contents for better performance. (They are very inefficient) 4 - Not really a TODO point but more of an observation and a realisation i have made. I could have just used regex to do the validation of my commands. How about that... Well im too far in (sunk cost fallacy or whatever its called). diff --git a/test/oldtests/i_validation_cases.txt b/test/oldtests/i_validation_cases.txt new file mode 100644 index 0000000..e437511 --- /dev/null +++ b/test/oldtests/i_validation_cases.txt @@ -0,0 +1,177 @@ +validate_check_p_m +Positive input (Valid): +L+ +L- +L-1 +L+1 +L-2 +L+2 +L-3 +L+3 +L-9 +L+9 +L-10 +L+10 +L+90 +L+100 +L+900 + +Positive (_NA): +L0 +L1 +L100 +LL +Lasd +L9 +L90 +L900 + +Negative (Invalid): +L+0 +L-0 +L-- +L++ +L+L +L-L +L+asd +L-asd +L-0- +L+0+ +L+0- +L-0+ +L-0 + +Overall results: Tested OK. Seems like its working like it should now. + +validate_check_imm +Positive input (Valid): +L +L1 +L9 +L10 +L90 +L900 +L100 + +Negative (Invalid): +LL +L+ +L+1 +L0 +L+0 +L00 +L0L + +Overall results: Tested OK. Seems like its working like it should. + +validate_plus_continue +Positive input (Valid): +L+1 +L+10 +L+9 +L+90 +L+5 +L+50 +L+11 +L+99 +L+345345 +L+12313213213213 + +Negative (Invalid): +L+1L +L+11L +L+9L +L+5L +L+90L +L+500+ +L+23+23 +L+13++ +L-10 +L+1+ + +Overall results: Tested OK. Seems fine. + +validate_imm_numbers +Positive input (Valid): +L1 +L2 +L9 +L10 +L10000 +L999 +L1112 +L3987453 + +Negative (Invalid): +L1- +L9+ +L1L +L9a +L1F +L9e +L100000000L +L942sA +L223+213123 +L2+1 + +Overall results: Tested OK. Seems fine. + +validate_L +Positive (valid): +L +L+ +L- +L1 +L10 +L9 +L90 +L5 +L50 +L500 +L900 +L100 +L9993221 +L100000000000 +L9234572 +L112323 +L100334 +L+1 +L-1 +L+10 +L+9 +L+90 +L+1000000000 +L+9992 +L+1020023023 +L-2323232323 + +Negative (invalid): +L++ +L-- +L+0 +L-0 +L0 +L00 +LL +LN +Lsada +L+a +L+abcdefg +L-a +L+0111a +L01203103 +L11212 +L+12n +L10+10 +L10-10 +L-1-1+1-1 +L+1+1+1 +L10+10+10 +L+10+1000 +L10+10 +l+10l +L10? +L+10? +L?10 + +Overall resuts: Tested OK. I don't think ive missed any checks for anything but hey you can never be sure. This is acceptable for now. \ No newline at end of file diff --git a/test/oldtests/smode_cases.txt b/test/oldtests/smode_cases.txt new file mode 100644 index 0000000..57f7e41 --- /dev/null +++ b/test/oldtests/smode_cases.txt @@ -0,0 +1,31 @@ +Positive: +L expected result: Valid +L+ expected result: Valid +L+4 expected result: Valid +L+34 expected result: Valid +L+4467 expected result: Valid +L24 expected result: Valid +L34553 expected result: Valid +L0 expected result: Valid +L- expected result: Valid +L-2 expected result: Valid +L-34 expected result: Valid + +Negative: +LL expected result: Invalid +L-0 expected result: Invalid +L+0 expected result: Invalid +L+l expected result: Invalid +L-l expected result: Invalid +L-43L expected result: Invalid +L+35L expected result: Invalid +L+021 expected result: Invalid +L+023L expected result: Invalid +L23l expected result: Invalid +L-012 expected result: Invalid +L-0L expected result: Invalid +L100+100 expected result: Invalid +L+100+100 expected result: Invalid +N100+100 expected result: Invalid +N+100+100 expected result: Invalid + diff --git a/test/oldtests/smode_cases2.txt b/test/oldtests/smode_cases2.txt new file mode 100644 index 0000000..dde7b88 --- /dev/null +++ b/test/oldtests/smode_cases2.txt @@ -0,0 +1,118 @@ +validate_LN with MODE_L: +Positive (valid): +L +L+ +L- +L+1 +L-1 +L+9 +L-9 +L+10 +L-10 +L+50 +L-50 +L+90 +L-90 +L+100 +L-100 +L+47383 +L-8877843 +L1 +L5 +L9 +L10 +L11 +L50 +L90 +L100 +L84355 +L2374827364 + +Negative (invalid AKA '?'): +L+0 +L-0 +L0 +L01212332 +L0+ +L+0+ +L+0+0 +L+1+0 +L+4- +L-0+10 +LL +LL+ +L+L +L+L12 +L+L+100 +L000000000000000000000000 +L+000000000000000000000 +L10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +L+10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +L-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +L+10000000000000000000000000000 (31 chars) +L+1000000000000000000000000000L (31 chars) +L+100000000000000000000000000L (30 chars) +L? +L?1 +L?1000 +LL100000 +L1000? + +Overall results: Tested OK + +validate_LN with MODE_N: +Positive (valid): +N +N+ +N+1 +N+9 +N+10 +N+50 +N+90 +N+100 +N+47383 +N1 +N5 +N9 +N10 +N11 +N50 +N90 +N100 +N84355 +N2374827364 + +Negative (invalid AKA '?'): +N- +N-1 +N-9 +N-10 +N-11 +N-50 +N-90 +N-100 +N-26347234 +N-10+ +N+10- +N+10+10 +N0 +N+0 +N+01 +N04453 +N+04343 +N-02343 +N03413 +N++ +N-- +N+10+10 +N-10-10 +N++10 +N--10 +NN +NNNNN +N?10 +N?999999 +N? +NL + +Overall results: Tested OK. \ No newline at end of file diff --git a/test/testcases/i_validation_cases.txt b/test/testcases/i_validation_cases.txt deleted file mode 100644 index e437511..0000000 --- a/test/testcases/i_validation_cases.txt +++ /dev/null @@ -1,177 +0,0 @@ -validate_check_p_m -Positive input (Valid): -L+ -L- -L-1 -L+1 -L-2 -L+2 -L-3 -L+3 -L-9 -L+9 -L-10 -L+10 -L+90 -L+100 -L+900 - -Positive (_NA): -L0 -L1 -L100 -LL -Lasd -L9 -L90 -L900 - -Negative (Invalid): -L+0 -L-0 -L-- -L++ -L+L -L-L -L+asd -L-asd -L-0- -L+0+ -L+0- -L-0+ -L-0 - -Overall results: Tested OK. Seems like its working like it should now. - -validate_check_imm -Positive input (Valid): -L -L1 -L9 -L10 -L90 -L900 -L100 - -Negative (Invalid): -LL -L+ -L+1 -L0 -L+0 -L00 -L0L - -Overall results: Tested OK. Seems like its working like it should. - -validate_plus_continue -Positive input (Valid): -L+1 -L+10 -L+9 -L+90 -L+5 -L+50 -L+11 -L+99 -L+345345 -L+12313213213213 - -Negative (Invalid): -L+1L -L+11L -L+9L -L+5L -L+90L -L+500+ -L+23+23 -L+13++ -L-10 -L+1+ - -Overall results: Tested OK. Seems fine. - -validate_imm_numbers -Positive input (Valid): -L1 -L2 -L9 -L10 -L10000 -L999 -L1112 -L3987453 - -Negative (Invalid): -L1- -L9+ -L1L -L9a -L1F -L9e -L100000000L -L942sA -L223+213123 -L2+1 - -Overall results: Tested OK. Seems fine. - -validate_L -Positive (valid): -L -L+ -L- -L1 -L10 -L9 -L90 -L5 -L50 -L500 -L900 -L100 -L9993221 -L100000000000 -L9234572 -L112323 -L100334 -L+1 -L-1 -L+10 -L+9 -L+90 -L+1000000000 -L+9992 -L+1020023023 -L-2323232323 - -Negative (invalid): -L++ -L-- -L+0 -L-0 -L0 -L00 -LL -LN -Lsada -L+a -L+abcdefg -L-a -L+0111a -L01203103 -L11212 -L+12n -L10+10 -L10-10 -L-1-1+1-1 -L+1+1+1 -L10+10+10 -L+10+1000 -L10+10 -l+10l -L10? -L+10? -L?10 - -Overall resuts: Tested OK. I don't think ive missed any checks for anything but hey you can never be sure. This is acceptable for now. \ No newline at end of file diff --git a/test/testcases/smode_cases.txt b/test/testcases/smode_cases.txt deleted file mode 100644 index 57f7e41..0000000 --- a/test/testcases/smode_cases.txt +++ /dev/null @@ -1,31 +0,0 @@ -Positive: -L expected result: Valid -L+ expected result: Valid -L+4 expected result: Valid -L+34 expected result: Valid -L+4467 expected result: Valid -L24 expected result: Valid -L34553 expected result: Valid -L0 expected result: Valid -L- expected result: Valid -L-2 expected result: Valid -L-34 expected result: Valid - -Negative: -LL expected result: Invalid -L-0 expected result: Invalid -L+0 expected result: Invalid -L+l expected result: Invalid -L-l expected result: Invalid -L-43L expected result: Invalid -L+35L expected result: Invalid -L+021 expected result: Invalid -L+023L expected result: Invalid -L23l expected result: Invalid -L-012 expected result: Invalid -L-0L expected result: Invalid -L100+100 expected result: Invalid -L+100+100 expected result: Invalid -N100+100 expected result: Invalid -N+100+100 expected result: Invalid - diff --git a/test/testcases/smode_cases2.txt b/test/testcases/smode_cases2.txt deleted file mode 100644 index dde7b88..0000000 --- a/test/testcases/smode_cases2.txt +++ /dev/null @@ -1,118 +0,0 @@ -validate_LN with MODE_L: -Positive (valid): -L -L+ -L- -L+1 -L-1 -L+9 -L-9 -L+10 -L-10 -L+50 -L-50 -L+90 -L-90 -L+100 -L-100 -L+47383 -L-8877843 -L1 -L5 -L9 -L10 -L11 -L50 -L90 -L100 -L84355 -L2374827364 - -Negative (invalid AKA '?'): -L+0 -L-0 -L0 -L01212332 -L0+ -L+0+ -L+0+0 -L+1+0 -L+4- -L-0+10 -LL -LL+ -L+L -L+L12 -L+L+100 -L000000000000000000000000 -L+000000000000000000000 -L10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -L+10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -L-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -L+10000000000000000000000000000 (31 chars) -L+1000000000000000000000000000L (31 chars) -L+100000000000000000000000000L (30 chars) -L? -L?1 -L?1000 -LL100000 -L1000? - -Overall results: Tested OK - -validate_LN with MODE_N: -Positive (valid): -N -N+ -N+1 -N+9 -N+10 -N+50 -N+90 -N+100 -N+47383 -N1 -N5 -N9 -N10 -N11 -N50 -N90 -N100 -N84355 -N2374827364 - -Negative (invalid AKA '?'): -N- -N-1 -N-9 -N-10 -N-11 -N-50 -N-90 -N-100 -N-26347234 -N-10+ -N+10- -N+10+10 -N0 -N+0 -N+01 -N04453 -N+04343 -N-02343 -N03413 -N++ -N-- -N+10+10 -N-10-10 -N++10 -N--10 -NN -NNNNN -N?10 -N?999999 -N? -NL - -Overall results: Tested OK. \ No newline at end of file diff --git a/test/testcases/version2cases.txt b/test/testcases/version2cases.txt new file mode 100644 index 0000000..6982e17 --- /dev/null +++ b/test/testcases/version2cases.txt @@ -0,0 +1,8 @@ +Not gonna make any test cases. The plan right now is to go through ALL +functionality with an exploratory type of testing. + +General things to test: +- Entry to the program -v and -i +- Most basic usage of COMMANDS +- Use commands with + and numbers. +- See how the program handles permissions -- cgit v1.2.3