Skip to content

Instantly share code, notes, and snippets.

@artemnikitin
Created September 11, 2018 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artemnikitin/94622709699a4f30bf5bcc36078974ed to your computer and use it in GitHub Desktop.
Save artemnikitin/94622709699a4f30bf5bcc36078974ed to your computer and use it in GitHub Desktop.
Test example
func TestReaderBlaBlaBla1(t *testing.T) {
descriptor := &TestMemoryDescriptor{Array: bytes} //input
result := Read(descriptor, 1, 1, false)
assert.Equal(t, 5, result,
"Result expected: %v, actual: %v, for test data: %v", v.expected, result, v)
}
func TestReaderBlaBlaBla2(t *testing.T) {
descriptor := &TestMemoryDescriptor{Array: bytes} //input
result := Read(descriptor, 1, 2, false)
assert.Equal(t, 3, result,
"Result expected: %v, actual: %v, for test data: %v", v.expected, result, v)
}
func TestReaderBlaBlaBla3(t *testing.T) {
descriptor := &TestMemoryDescriptor{Array: bytes} //input
result := Read(descriptor, 2, 2, true)
assert.Equal(t, 12, result,
"Result expected: %v, actual: %v, for test data: %v", v.expected, result, v)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment