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
44 44
45// Rename to TestParseDate to make an actual (failing) test.45// Rename to TestParseDate to make an actual (failing) test.
46func Example_parseDate(t *testing.T) {46func 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
48 s := fmt.Sprintf("%04d-%02d-%02d", y, m, d)52 s := fmt.Sprintf("%04d-%02d-%02d", y, m, d)
49 53
50 y_, m_, d_, err := ParseDate(s)54 y_, m_, d_, err := ParseDate(s)
@@ -55,5 +59,5 @@ func Example_parseDate(t *testing.T) { · 4 unmodified lines
55 if y_ != y || m_ != m || d_ != d {59 if y_ != y || m_ != m || d_ != d {
56 t.Fatalf("got back wrong date: (%d, %d, %d)", y_, m_, d_)60 t.Fatalf("got back wrong date: (%d, %d, %d)", y_, m_, d_)
57 }61 }
58 }, rapid.IntsRange(0, 9999), rapid.IntsRange(1, 12), rapid.IntsRange(1, 31))62 })
59}63}

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