Skip to content

Commit e8c7bc9

Browse files
committed
Add example to YAMLEq
1 parent a78e373 commit e8c7bc9

File tree

5 files changed

+96
-0
lines changed

5 files changed

+96
-0
lines changed

assert/assertion_format.go

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertion_forward.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assert/assertions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,18 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{
18811881
}
18821882

18831883
// YAMLEq asserts that the first document in the two YAML strings is equivalent.
1884+
//
1885+
// expected := `---
1886+
// key: value
1887+
// ---
1888+
// key: this is a second document, it is not evaluated
1889+
// `
1890+
// actual := `---
1891+
// key: value
1892+
// ---
1893+
// key: this is a subsequent document, it is not evaluated
1894+
// `
1895+
// assert.YAMLEq(t, expected, actual)
18841896
func YAMLEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool {
18851897
if h, ok := t.(tHelper); ok {
18861898
h.Helper()

require/require.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

require/require_forward.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)