Skip to content

feat:fun test runner, test library, docs and demo - #26

Merged
funlang merged 1 commit into
mainfrom
feat-fun-test
Oct 21, 2026
Merged

funlang merged 1 commit into
mainfrom
feat-fun-test

Conversation

@taadis

@taadis taadis commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

新增测试库和测试相关工具链

文档和示例已补

README(中英)

  • 目录新增 Testing / 测试
  • Packages / 包管理 之后新增测试章节:发现规则、use 'test.fun'、fun test、断言 API、保留名、依赖/lib-only
    说明
  • 标准库列表加 test,模块数 61→62(README 中所有计数已同步)
  • Examples 增加 test-demo 链接

示例 fun/demos/test-demo/
package.fun # lib-only 包(无 bin)
src/lib.fun # add / safe_div
tests/calc_test.fun # 4 个用例:equal/helper/raises
tests/helpers.fun # 共享 helper(自己 use 'test.fun')
README.md # 通过/失败输出、运行命令、约定

实际运行结果:

cd fun/demos/test-demo
../../../src/prj/fun/funcmd test
tests/calc_test.fun PASS (4)
1 file, 4 tests: all passed

失败示例(README 里也写了):

tests/calc_test.fun FAIL
not ok broken
math is broken
expected 3, got 2
1 file, 5 tests: 4 passed, 1 failed

@funlang
funlang merged commit e3bb7b9 into main Oct 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants