From a61d928b279c5c508aca3bfc7cb14d810c3d75de Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Tue, 20 May 2025 07:19:33 +0200 Subject: vault backup: 2025-05-20 07:19:33 --- Table driven tests.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Table driven tests.md (limited to 'Table driven tests.md') diff --git a/Table driven tests.md b/Table driven tests.md new file mode 100644 index 0000000..e2b2f3a --- /dev/null +++ b/Table driven tests.md @@ -0,0 +1,14 @@ +--- +tags: + - testing +--- +https://go.dev/wiki/TableDrivenTests +--- + +[[Testing Golang programs]] [[Test fixture]] + +--- + +Sign when to use: copy and pasting tests. +Similar to what we do with phpunit/prophecy : providing a dataProvider. +In go we can just define a slice of structs or a map and loop over it in our test function. \ No newline at end of file -- cgit v1.2.3