test(11.1-07): planted fixtures and unit tests for fence, execution and name-form holes
- eighteen violation plants pin nested src=, Go aliases, unrun examples, build membership and command forms - unit tests cover fence collection, captions, goLang, go doc -c, commandWord and Sync
This commit is contained in:
19
internal/docsite/testdata/violations/snippet-build-ignored-test-root/docs/extras/faq.md
vendored
Normal file
19
internal/docsite/testdata/violations/snippet-build-ignored-test-root/docs/extras/faq.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: FAQ
|
||||
description: "Questions about the demo."
|
||||
section: extras
|
||||
order: 20
|
||||
---
|
||||
# FAQ
|
||||
|
||||
## Does it migrate
|
||||
|
||||
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
|
||||
|
||||
```text
|
||||
summer not:checked in a text fence
|
||||
```
|
||||
|
||||
```go src=modules/demo/demo_test.go#ignoredOnly
|
||||
func ignoredOnly() string { return "x" }
|
||||
```
|
||||
15
internal/docsite/testdata/violations/snippet-build-ignored-test-root/modules/demo/demo_test.go
vendored
Normal file
15
internal/docsite/testdata/violations/snippet-build-ignored-test-root/modules/demo/demo_test.go
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package demo
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestGreet(t *testing.T) {
|
||||
// docs:start greet
|
||||
g := Greeter{Name: "blog"}
|
||||
got := g.Greet()
|
||||
// docs:end greet
|
||||
if got != "Hello, blog" {
|
||||
t.Fatalf("Greet() = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func ignoredOnly() string { return "x" }
|
||||
@@ -0,0 +1,7 @@
|
||||
//go:build ignore
|
||||
|
||||
package demo
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestIgnored(t *testing.T) { _ = ignoredOnly() }
|
||||
3
internal/docsite/testdata/violations/snippet-build-ignored-test-root/want.txt
vendored
Normal file
3
internal/docsite/testdata/violations/snippet-build-ignored-test-root/want.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
rule: snippet
|
||||
file: docs/extras/faq.md
|
||||
message: fragment is not inside a Test or Example function
|
||||
Reference in New Issue
Block a user