MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_canFinish

Function Test_canFinish

course_schedule_207/solution_test.go:8–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func Test_canFinish(t *testing.T) {
9 type args struct {
10 numCourses int
11 prerequisites [][]int
12 }
13 tests := []struct {
14 name string
15 args args
16 want bool
17 }{
18 {
19 name: "course schedule",
20 args: args{
21 numCourses: 2,
22 prerequisites: [][]int{
23 {1, 0},
24 },
25 },
26 want: true,
27 },
28 {
29 name: "course schedule",
30 args: args{
31 numCourses: 2,
32 prerequisites: [][]int{
33 {1, 0},
34 {0, 1},
35 },
36 },
37 want: false,
38 },
39 {
40 name: "course schedule",
41 args: args{
42 numCourses: 3,
43 prerequisites: [][]int{
44 {0, 1},
45 {1, 2},
46 {2, 0},
47 },
48 },
49 want: false,
50 },
51 {
52 name: "course schedule",
53 args: args{
54 numCourses: 3,
55 prerequisites: [][]int{
56 {0, 1},
57 {0, 2},
58 {1, 2},
59 },
60 },
61 want: true,
62 },
63 {
64 name: "course schedule",
65 args: args{

Callers

nothing calls this directly

Calls 2

canFinishDFSFunction · 0.85
canFinishBFSFunction · 0.85

Tested by

no test coverage detected