Autograding using C language - Multiple Expected Output

Hi everyone, I’ve been using GitHub Classroom Assignments for my Data Structure class. How can I auto-grade the assignment if have multiple expected outputs, for example like this:

value for index 0 is 2
value for index 1 is 6

looking forward to your kind help and reply. thank you

Two ways I can think of offhand:

  1. You can use two tests. One for each case. This has the benefit of being able to assign partial credit if students have one test passing and not the other.
  2. You can use a regex comparison and ensure that both values are found as expected, e.g.
	{
		"name": "Verify working main (simple)",
		"setup": "",
		"run": "timeout 10 make simple-main",
		"input": "",
		"output": "0 is 2(\n|.)*1 is 6",
		"comparison": "regex",
		"timeout": 1,
		"points": 10
	},