-
Notifications
You must be signed in to change notification settings - Fork 0
Fail report showcase
bayashi edited this page May 21, 2023
·
7 revisions
a.Got("").Nil(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox1163385091/prog_test.go:10
Function: Test()
Expected: <nil>
Actually got: Type:string, ""
--- FAIL: Test (0.00s)
FAILa.Got(nil).NotNil(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox331591686/prog_test.go:10
Function: Test()
Fail reason: Expected other than <nil>, but got <nil>
Expected: Not <nil>
Actually got: <nil>
--- FAIL: Test (0.00s)
FAILa.Got(1).True(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox543705390/prog_test.go:10
Function: Test()
Fail reason: Different type
Expected: Boolean type <true>
Actually got: Type:int, 1
--- FAIL: Test (0.00s)
FAILa.Got(false).True(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox1884561809/prog_test.go:10
Function: Test()
Expected: Boolean type <true>
Actually got: false
--- FAIL: Test (0.00s)
FAILa.Got(0).False(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox414188558/prog_test.go:10
Function: Test()
Fail reason: Different type
Expected: Boolean type <false>
Actually got: Type:int, 0
--- FAIL: Test (0.00s)
FAILa.Got("aiko").Expect("eiko").Same(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox2938945883/prog_test.go:10
Function: Test()
Fail reason: Not same value
Expected: Dump: "eiko"
Actually got: Dump: "aiko"
Diff Details: --- Expected
+++ Actually got
@@ -1 +1 @@
-eiko
+aiko
--- FAIL: Test (0.00s)
FAILa.Got(int32(123)).Expect(float32(123)).Same(t)=== RUN Test
prog_test.go:10:
Trace: /tmp/sandbox4125056554/prog_test.go:10
Function: Test()
Fail reason: Different type
Expected: Type: float32, Dump: 123
Actually got: Type: int32, Dump: 123
--- FAIL: Test (0.00s)
FAILfunc TestRoot3ChildrenGChildWithProp(t *testing.T) {
expect := `
┌* root: tag
│ root description
├─┬+ Child: tag
│ │ Child description
│ └──$ G-Child: tag
│ G-Child description
├──+ Child2: Tag
│ Child2 description
└──+ Child3: Tag
Child3 description
`
root := Node("root").Icon("*").Tag("tag").Description("root description")
child := Node("Child").Icon("+").Tag("tag").Description("Child description")
gchild := Node("G-Child").Icon("$").Tag("tag").Description("G-Child description")
child2 := Node("Child2").Icon("+").Tag("tag").Description("Child2 description")
child3 := Node("Child3").Icon("+").Tag("tag").Description("Child3 description")
tree := root.Append(child.Append(gchild)).Append(child2).Append(child3)
actually.Got(render(tree)).Expect(expect).X().Same(t)
}Comparing by Same() with X() to show raw output.
render_test.go:111:
Trace: /home/bayashi/go/src/github.com/bayashi/go-proptree/render_test.go:111
Function: TestRoot3ChildrenGChildWithProp()
Fail reason: Not same value
Expected: Dump: "\n┌* root: tag\n│ root description\n├─┬+ Child: tag\n│ │ Child description\n│ └──$ G-Child: tag\n│ G-Child description\n├──+ Child2: Tag\n│ Child2 description\n└──+ Child3: Tag\n Child3 description\n"
Actually got: Dump: "\n┌* root: tag\n│ root description\n├─┬+ Child: tag\n│ │ Child description\n│ └──$ G-Child: tag\n│ G-Child description\n├──+ Child2: tag\n│ Child2 description\n└──+ Child3: tag\n Child3 description\n"
Diff Details: --- Expected
+++ Actually got
@@ -7,5 +7,5 @@
│ G-Child description
-├──+ Child2: Tag
+├──+ Child2: tag
│ Child2 description
-└──+ Child3: Tag
+└──+ Child3: tag
Child3 description
Expected Raw: ---
┌* root: tag
│ root description
├─┬+ Child: tag
│ │ Child description
│ └──$ G-Child: tag
│ G-Child description
├──+ Child2: Tag
│ Child2 description
└──+ Child3: Tag
Child3 description
---
Got Raw: ---
┌* root: tag
│ root description
├─┬+ Child: tag
│ │ Child description
│ └──$ G-Child: tag
│ G-Child description
├──+ Child2: tag
│ Child2 description
└──+ Child3: tag
Child3 description
---