Skip to content
Back to skills

Test Equal

ASecurity

When testing Either values, compare the value directly with shouldBe instead of checking isLeft, so test failures show the actual value. Use when writing or reviewing Haskell test code that asserts on Either or similar values.

  • 3 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added May 27, 2026
data-aitesting

Security analysis

A100/100

Scanned November 28, 2026

npx -y skills add ncaq/konoka --skill test-equal --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Equal?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Equal
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ncaq-test-equal/badge)](https://www.skillsdirectory.com/skills/ncaq-test-equal)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-equal
description: When testing Either values, compare the value directly with shouldBe instead of checking isLeft, so test failures show the actual value. Use when writing or reviewing Haskell test code that asserts on Either or similar values.
user-invocable: false
---

# テストでは値を直接比較する

`Either`などの値をテストするときに、
`isLeft`のような判定の結果を`True`と比較する書き方は避けます。
実際にどのような値が入っていたのかがテストフレームワークに伝わらず、
テストが失敗したときに情報がなくなるためです。

```haskell
-- 避ける
isLeft x `shouldBe` True

-- 良い
x `shouldBe` Left "expected error"
```

値が`Show`と`Eq`のインスタンスなら、期待する値と直接比較します。
`Eq`のインスタンスでない場合も、`isLeft`の結果を`shouldBe`に渡すのではなく、
中身の振る舞いを検査できる関数がテストフレームワークに用意されているはずなので、それを使います。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data-ai →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.