mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
test: made each issue a subtest
Allow each test to be a subtest, so users can run things like: ```sh go test -v ./... -run 'TestRendererIssues/107' ``` In order to run a single issue test, which helps when trying to fix a new one. Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
5dc4fa673f
commit
1e311cd4e1
@@ -105,6 +105,7 @@ func TestRendererIssues(t *testing.T) {
|
||||
|
||||
for _, f := range files {
|
||||
bn := strings.TrimSuffix(filepath.Base(f), ".md")
|
||||
t.Run(bn, func(t *testing.T) {
|
||||
tn := filepath.Join(issuesDir, bn+".test")
|
||||
|
||||
in, err := ioutil.ReadFile(f)
|
||||
@@ -153,7 +154,7 @@ func TestRendererIssues(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
continue
|
||||
return
|
||||
}
|
||||
|
||||
// verify
|
||||
@@ -166,5 +167,6 @@ func TestRendererIssues(t *testing.T) {
|
||||
t.Errorf("Rendered output for %s doesn't match!\nExpected: `\n%s`\nGot: `\n%s`\n",
|
||||
bn, string(td), buf.String())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user