概要 Haskellのstackのプロジェクトで、HSpecでテストを書く時、複数テストファイルを同時に走らせたかったら、Automatic spec discoveryを使う。senseiを使うとなお便利。 背景 stackを使ってwebアプリっぽいものを作る過程で、複数のHSpecテストファイルができたのだが、それらをまとめて走らせる良い方法がわからず詰まったのでメモする。 環境 MacOS Big Sur 11.4 MacBook Air M1 stack 2.7.1 やり方 I. HSpecのAutomatic spec discoveryを使って、複数ファイルのテストコードをstack testで実行できるようにする stack new (プロジェクト名)で適当なstackプロジェクトを作る。 package.yamlの、testsという項目の、(プロジェクト名)-testという
At the end of Zurihac this year, I released a preview version of HMock, a new library for testing with mocks in Haskell. Let’s talk about what this is, why I wrote it, and how you can use it. A Toy ChatbotLet’s suppose I want to write a chatbot in Haskell. I might start with a few types, like so… newtype User = User String deriving (Eq, Show) data PermLevel = Guest | NormalUser | Admin deriving (E
There is only one source file Test.Tasty.Bench and no non-boot dependencies except tasty. So if you already depend on tasty for a test suite, there is nothing else to install. Compare this to criterion (10+ modules, 50+ dependencies) and gauge (40+ modules, depends on basement and vector). A build on a clean machine is up to 16x faster than criterion and up to 4x faster than gauge. A build without
競技プログラミングでは、提出したプログラムが誤答(WA)だった場合に「どのような入力について」答えを間違えたのか(参加者には)分からないことが多いです。 こういう場合はエスパーするなり眼力でソースコードをぐっと睨んだりするとバグが発見できる場合もありますが、初心者にはそういうのは難しいでしょう。 この記事では、HaskellのQuickCheckというライブラリーを使って、「ランダムにテストケースを生成して素朴な解と一致するか」を自動で検証させます。QuickCheckはテストに失敗した場合に「どういう入力例に対して失敗したか」も教えてくれるので、デバッグにも役立ちます。 この記事は筆者が先日YouTubeに上げた動画を文章で書き直したものです。動画で触れられなかった・触れるのを忘れていた補足説明みたいなものも若干含んでいます。この記事と動画、両方見ていただけると嬉しいです。 今回取り上げ
A framework to manage external applications for system tests View the Project on GitHub gree/haskell-test-sandbox Download ZIP File Download TAR Ball View On GitHub Description test-sandbox is a framework to manage external applications and communicate with them via TCP or standard I/O for system testing in a sandboxed environment. The Test.Sandbox monad can either be used stand-alone or in conjun
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く