(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestParseDescriptions(t *testing.T) { |
| 55 | tests := []struct { |
| 56 | name string |
| 57 | in string |
| 58 | out []string |
| 59 | }{ |
| 60 | { |
| 61 | name: "empty", |
| 62 | }, |
| 63 | { |
| 64 | name: "single", |
| 65 | in: "hello", |
| 66 | out: []string{"hello"}, |
| 67 | }, |
| 68 | { |
| 69 | name: "multi", |
| 70 | in: "bar\nbaz\n\nfoo", |
| 71 | out: []string{"bar\nbaz", "foo"}, |
| 72 | }, |
| 73 | { |
| 74 | name: "multi", |
| 75 | in: "hello\n\n\nworld", |
| 76 | out: []string{"hello", "world"}, |
| 77 | }, |
| 78 | } |
| 79 | |
| 80 | for _, tst := range tests { |
| 81 | tc := tst |
| 82 | t.Run(tc.name, func(t *testing.T) { |
| 83 | out := ParseDescriptions(tc.in) |
| 84 | if !reflect.DeepEqual(out, tc.out) { |
| 85 | t.Errorf("ParseDescriptions() got %v, wanted %v", out, tc.out) |
| 86 | } |
| 87 | }) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func TestNewDoc(t *testing.T) { |
| 92 | tests := []struct { |
nothing calls this directly
no test coverage detected