Last active
September 12, 2022 22:24
-
-
Save snassr/af5850ee969e5ee0d8fb6244d91781a9 to your computer and use it in GitHub Desktop.
Medium Blog - Unit Testing in Go (Golang) - Singly Linked List Test Suite File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func TestSinglyLinkedList(t *testing.T) { | |
for title, fn := range map[string]func(t *testing.T){ | |
"append item to list": testAppend, // test: append functionality | |
"return items in list": testValues, // test: values functionality | |
} { | |
t.Run(title, func(t *testing.T) { | |
fn(t) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment