登录 注册
开发者工具数据分析与数据处理 golden-testshaskellhunitquickchecksmallchecktesting
663
Stars
124
Forks
14
Watchers
28
Open Issues
待补全
许可证
Haskell
语言
2013-04-22
创建时间
2026-11-08
最近更新

项目能做什么

Tasty 是 Haskell 的现代化测试框架。它解决了各类测试难以统一管理的问题,能将单元测试、Golden 测试及 QuickCheck 等属性测试整合进同一个测试套件。核心功能包括多测试并发执行且确定性输出、命令行模式过滤、层级着色统计展示、跨测试资源管理及高度可扩展性。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Tasty

**Tasty** is a modern testing framework for Haskell.

It lets you combine your unit tests, golden tests, QuickCheck/SmallCheck
properties, and any other types of tests into a single test suite.

Features:

* Run tests in parallel but report results in a deterministic order
* Filter the tests to be run using patterns specified on the command line
* Hierarchical, colored display of test results
* Reporting of test statistics
* Acquire and release resources (sockets, temporary files etc.) that can be
  shared among several tests
* Extensibility: add your own test providers and ingredients (runners) above and
  beyond those provided

To find out what's new, read the **[change log][]**.

[change log]: https://github.com/UnkindPartition/tasty/blob/master/core/CHANGELOG.md

## Example

Here's how your `test.hs` might look like:

```haskell
import Test.Tasty
import Test.Tasty.SmallCheck as SC
import Test.Tasty.QuickCheck as QC
import Test.Tasty.HUnit

import Data.List
import Data.Ord

main = defaultMain tests

tests :: TestTree
tests = testGroup "Tests" [properties, unitTests]

properties :: TestTree
properties = testGroup "Properties" [scProps, qcProps]

scProps = testGroup "(checked by SmallCheck)"
  [ SC.testProperty "sort == sort . reverse" $
      \list -> sort (list :: [Int]) == sort (reverse list)
  , SC.testProperty "Fermat's little theorem" $
      \x -> ((x :: Integer)^7 - x) `mod` 7 == 0
  -- the following property does not hold
  , SC.testProperty "Fermat's last theorem" $
      \x y z n ->
        (n :: Integer) >= 3 SC.==> x^n + y^n /= (z^n :: Integer)
  ]

qcProps = testGroup "(checked by QuickCheck)"
  [ QC.testProperty "sort == sort . reverse" $
      \list -> sort (list :: [Int]) == sort (reverse list)
  , QC.testProperty "Fermat's little theorem" $
      \x -> ((x :: Integer)^7 - x) `mod` 7 == 0
  -- the following property does not hold
  , QC.testProperty "Fermat's last theorem" $
      \x y z n ->
        (n :: Integer) >= 3 QC.==> x^n + y^n /= (z^n :: Integer)
  ]

unitTests = testGroup "Unit tests"
  [ testCase "List comparison (different length)" $
      [1, 2, 3] `compare` [1,2] @?= GT

  -- the following test does not hold
  , testCase "List comparison (same length)" $
      [1, 2, 3] `compare` [1,2,2] @?= LT
  ]
```

And here is the output of the above program:

![](https://raw.github.com/UnkindPartition/tasty/master/screenshot.png)

(Note that whether QuickCheck finds a counterexample to the third property is
determined by chance.)

## Packages

[tasty][] is the core package. It contains basic definitions and APIs and a
console runner.

[tasty]: https://hackage.haskell.org/package/tasty

In order to create a test suite, you also need to install one or more «providers» (see
below).

### Providers

The following providers exist:

* [tasty-hunit](https://hackage.haskell.org/package/tasty-hunit) — for unit tests
  (based on [HUnit](https://hackage.haskell.org/package/HUnit))
* [tasty-golden][] — for golden
  tests, which 
阅读完整原文

项目深度分析 AI 生成

Tasty 云端 Golden Tests 审查与版本管理平台 (SaaS)

产品构想利用 tasty-golden 的测试结果,搭建 Web 端的快照可视化、自动化比对、审批流与版本历史托管服务。
核心功能Tasty 自定义 Ingredient/Reporter 自动上传差异快照、Web UI 差异对比(文本/图片/JSON)、团队一键 Approve 并自动更新 Git 分支基准。
目标用户使用 Haskell 开发编译器、DSL、渲染引擎或金融报表等依赖文件快照比对的技术团队。
难度/周期中等 · 2-3 个月 · 成本:低(主要为云存储与轻量 Web 服务服务器成本)
收费模式免费额度 + 席位/存储容量订阅付费 (Freemium SaaS)。
竞争风险Haskell 生态受众总体基数较小,纯针对 Haskell 的市场天花板过低。
依据 AI推测

面向高可靠 Haskell 系统的测试咨询与性能/并发优化服务

产品构想以 Tasty 官方/专家生态为背书,为区块链、金融量化等 Haskell 核心生产团队提供复杂集成测试架构、属性测试(QuickCheck/Hedgehog)覆盖与 CI 提速咨询。
核心功能测试用例体系重构、基于 Tasty 的大规模并发测试优化、Golden 测试策略落地、形式化验证结合。
目标用户金融科技、区块链底层协议研发等对代码正确性有极高要求的商业公司。
难度/周期高 · 按项目交付,单次 1-4 周 · 成本:极低(主要是专家工时成本)
收费模式按人天咨询费或按项目里程碑收取顾问费用。
竞争风险高度依赖个人技术声誉与 Haskell 工业界人脉,业务难以规模化复利。
依据 尚需验证的假设

Tasty 企业级 CI 报告与质量仪表盘插件 (On-Premises / Enterprise)

产品构想开发针对 Tasty 的企业级 Ingredient 扩展,支持向 Datadog、Elastic 或私有仪表盘输出高维度测试用例耗时、不稳定测试(Flaky Tests)追踪与合规报告。
核心功能Flaky Tests 自动标记与重试机制、跨构建用例耗时趋势分析、结构化 JUnit/OpenTelemetry 导出、合规审计日志。
目标用户有合规审查需求、大型 Monorepo 或长期 CI 耗时痛点的中大型 Haskell 企业用户。
难度/周期低至中等 · 1-2 个月 · 成本:极低
收费模式双重许可(核心库开源,企业分析与企业 CI 插件收取年费授权)。
竞争风险企业可轻易自行基于 Tasty 开放接口自研简单 reporter 替代。
依据 已验证事实
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2013-04-22,近 30 天仍在推送
社区活跃Star 663 / Fork 124 / Issue 28(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。