Skip to content

feat: stdlib uuid module with fun test - #27

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

funlang merged 1 commit into
mainfrom
feat-fun-uuid

Conversation

@taadis

@taadis taadis commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

新增 UUID 实现

fun/lib/uuid.fun

  • UUID() 生成 RFC 9562 v4:小写 8-4-4-4-12,version 4,variant 10xx
  • 随机源:Unix getentropy(),Windows advapi32.SystemFunction036(RtlGenRandom)
  • 绑定/调用失败直接 raise,不降级伪随机;无全局状态、无种子
  • 纯 Fun + FFI,无解析器/核心改动

用 fun test 测试

fun/test/fun-uuid/
package.fun # 最小项目(无 bin/lib)
uuid_test.fun # 3 个用例:格式、version+variant、1000 次唯一
fun/test/lib-fun-uuid-test.fun # 上游 wrapper:跑 fun test,进 regression-list

夹具实际输出:

uuid_test.fun PASS (3)
1 file, 3 tests: all passed

@funlang
funlang merged commit 7ed3da5 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