Skip to content

Instantly share code, notes, and snippets.

@snassr
Last active September 12, 2022 22:24
Show Gist options
  • Save snassr/af5850ee969e5ee0d8fb6244d91781a9 to your computer and use it in GitHub Desktop.
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
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