parser

package
v0.5.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCargoTest

func ParseCargoTest(output string) types.TestResult

ParseCargoTest 解析 cargo test 输出,返回 TestResult

func ParseGoTest

func ParseGoTest(output string) types.TestResult

ParseGoTest 解析 `go test -v` 输出,返回结构化结果

go test -v 输出格式:

=== RUN   TestAdd
--- PASS: TestAdd (0.00s)
=== RUN   TestAdd_Negative
    calc_test.go:42: got -1, want 0
--- FAIL: TestAdd_Negative (0.00s)
FAIL
coverage: 50.0% of statements
FAIL	github.com/example/calc	0.001s

func ParseJUnitTest

func ParseJUnitTest(output string) types.TestResult

ParseJUnitTest 解析 Java JUnit 测试输出(Maven/Gradle/JUnit 5)

func ParseJestTest

func ParseJestTest(output string) types.TestResult

ParseJestTest 解析 Jest 测试输出

Jest 输出格式示例: PASS ./sum.test.js

✓ adds 1 + 2 to equal 3 (1 ms)
✓ adds 1 + 1 to equal 2

FAIL ./sum.test.js

✕ adds 1 + 2 to equal 3 (1 ms)
  expect(received).toBe(expected)

func ParseMochaTest

func ParseMochaTest(output string) types.TestResult

ParseMochaTest 解析 Mocha 测试输出

Mocha 输出格式示例:

calc
  ✓ add() should add numbers
  ✓ subtract() should subtract numbers
  1) divide() should handle division by zero

1 passing (9ms)
1 failing

func ParsePytestTest

func ParsePytestTest(output string) types.TestResult

ParsePytestTest 解析 pytest 测试输出

pytest -v 输出格式示例: test_demo.py::test_add PASSED test_demo.py::test_subtract PASSED test_demo.py::test_divide FAILED

=================================== FAILURES =================================== _______________________________ test_divide ________________________________ def test_divide():

assert divide(1, 0) == 0

AssertionError: division by zero

func ParseTestOutput

func ParseTestOutput(output, framework string) types.TestResult

ParseTestOutput 根据框架类型解析测试输出

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL