MCPcopy
hub / github.com/livebud/bud / TestStructInStruct

Function TestStructInStruct

framework/controller/controller_test.go:1898–1925  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1896}
1897
1898func 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
1928func TestLoadController(t *testing.T) {

Callers

nothing calls this directly

Calls 9

NewFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NoErrMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65
WriteMethod · 0.45
StdoutMethod · 0.45
StderrMethod · 0.45

Tested by

no test coverage detected