| 1896 | } |
| 1897 | |
| 1898 | func TestStructInStruct(t *testing.T) { |
| 1899 | is := is.New(t) |
| 1900 | ctx := context.Background() |
| 1901 | dir := t.TempDir() |
| 1902 | td := testdir.New(dir) |
| 1903 | td.Files["model/post/post.go"] = ` |
| 1904 | package post |
| 1905 | type Model struct {} |
| 1906 | ` |
| 1907 | td.Files["controller/controller.go"] = ` |
| 1908 | package controller |
| 1909 | import "context" |
| 1910 | import "app.com/model/post" |
| 1911 | type Controller struct {} |
| 1912 | type Post struct { |
| 1913 | Model post.Model |
| 1914 | } |
| 1915 | func (c *Controller) Show(ctx context.Context, id int) (post *Post, err error) { |
| 1916 | return &Post{}, nil |
| 1917 | } |
| 1918 | ` |
| 1919 | is.NoErr(td.Write(ctx)) |
| 1920 | cli := testcli.New(dir) |
| 1921 | result, err := cli.Run(ctx, "build") |
| 1922 | is.NoErr(err) |
| 1923 | is.Equal(result.Stdout(), "") |
| 1924 | is.Equal(result.Stderr(), "") |
| 1925 | } |
| 1926 | |
| 1927 | // https://github.com/livebud/bud/issues/101 |
| 1928 | func TestLoadController(t *testing.T) { |