Jul 20, 2023

Decorate tests with a no-exceptions assertion

TestLives provides only one function, lives_and, which works almost exactly like the function of the same name in TestException. That is, it allows you to test things that could but shouldn’t throw an exception without having to have two separate tests with two separate results and two separate descriptions.

You pass it a block of code to run which should contain one test assertion and a test description to give the assertion inside the block.

The description will be available inside the block in the $_ variable. This is different from TestException, which employs hacky magic to relieve you of having to pass the description to the decorated assertion.

If the block ends up throwing an exception, a test failure will be logged.

Checkout these related ports:
  • Zziplib - Library to provide transparent read access to zipped files
  • Zydis - Fast and lightweight x86/x86-64 disassembler library
  • Zycore-c - Support library with platform independent types, macros, etc for Zydis
  • Zthread - Platform-independent object-oriented C++ threading library
  • Zookeeper - Coordination Service for Distributed Applications
  • Zls - Zig LSP implementation + Zig Language Server
  • Zfp - High throughput library for compressed floating-point arrays
  • Zeal - Offline documentation browser
  • Zapcc - C++ caching compiler based on clang
  • Zanata-platform - Web-based translation platform
  • Zanata-cli - Zanata Java command line client
  • Z88dk - Complete Z80/Z180 development kit
  • Z80ex - ZiLOG Z80 CPU emulator library
  • Z80asm - Assembler for the Z80 microprocessor
  • Z80-asm - Z80 assembly code assembler and disassembler