History

Goodbye rapid.Bind()

Gregory Petrosyan committed 7 years ago

Commit b9a56a31 parent 4f37ba614 files · +177 −165Browse files

Showing the changes to example_function_test.go (1 of 14 files). Show all

Unified · Split

example_function_test.go+6−2
@@ -44,7 +44,11 @@ func ParseDate(s string) (int, int, int, error) { · 43 unmodified lines
4444
4545 // Rename to TestParseDate to make an actual (failing) test.
4646 func Example_parseDate(t *testing.T) {
47− rapid.Check(t, func(t *rapid.T, y int, m int, d int) {
47+ rapid.Check(t, func(t *rapid.T) {
48+ y := rapid.IntsRange(0, 9999).Draw(t, "y").(int)
49+ m := rapid.IntsRange(1, 12).Draw(t, "m").(int)
50+ d := rapid.IntsRange(1, 31).Draw(t, "d").(int)
51+
4852 s := fmt.Sprintf("%04d-%02d-%02d", y, m, d)
4953
5054 y_, m_, d_, err := ParseDate(s)
@@ -55,5 +59,5 @@ func Example_parseDate(t *testing.T) { · 4 unmodified lines
5559 if y_ != y || m_ != m || d_ != d {
5660 t.Fatalf("got back wrong date: (%d, %d, %d)", y_, m_, d_)
5761 }
58− }, rapid.IntsRange(0, 9999), rapid.IntsRange(1, 12), rapid.IntsRange(1, 31))
62+ })
5963 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t