loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix yaml test (#27297)

authored by

Lunny Xiao and committed by
GitHub
e59c9e3e c5247eff

+6 -3
+3 -1
models/fixture_generation.go
··· 40 40 fmt.Fprintf(&b, " user_id: %d\n", a.UserID) 41 41 fmt.Fprintf(&b, " repo_id: %d\n", a.RepoID) 42 42 fmt.Fprintf(&b, " mode: %d\n", a.Mode) 43 - fmt.Fprintf(&b, "\n") 43 + if i < len(accesses)-1 { 44 + fmt.Fprintf(&b, "\n") 45 + } 44 46 } 45 47 46 48 return b.String(), nil
+3 -2
models/fixture_test.go
··· 22 22 if !assert.NoError(t, err) { 23 23 return 24 24 } 25 - bytes, err := os.ReadFile(filepath.Join(unittest.FixturesDir(), name+".yml")) 25 + p := filepath.Join(unittest.FixturesDir(), name+".yml") 26 + bytes, err := os.ReadFile(p) 26 27 if !assert.NoError(t, err) { 27 28 return 28 29 } 29 30 data := string(util.NormalizeEOL(bytes)) 30 - assert.True(t, data == expected, "Differences detected for %s.yml", name) 31 + assert.EqualValues(t, expected, data, "Differences detected for %s", p) 31 32 } 32 33 33 34 test(GetYamlFixturesAccess, "access")