Golang testing: Difference between revisions

From wikinotes
(Created page with "Go ships with a test suite. = Example = <blockquote> {{ TODO | finish }} <syntaxhighlight lang="go"> package mypackage func Hello(name string) string { return "Hello, "...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Go ships with a test suite.
Go ships with a very minimalist test library, there are also other alternatives.


= Example =
= Notes =
<blockquote>
<blockquote>
{{ TODO |
{| class="wikitable"
finish }}
|-
 
| [[golang fuzzing]]
<syntaxhighlight lang="go">
|-
package mypackage
| [[golang std testing]]
 
|-
func Hello(name string) string {
| [[golang testify]]
    return "Hello, " + name
|-
}
|}
</syntaxhighlight>
</blockquote><!-- Notes -->
 
<syntaxhighlight lang="go">
// myproject/mypackage/mylib_test.go
package mypackage
 
import "testing"
 
</syntaxhighlight>
</blockquote><!-- Example -->

Latest revision as of 20:24, 1 August 2022

Go ships with a very minimalist test library, there are also other alternatives.

Notes

golang fuzzing
golang std testing
golang testify