How to test program behaviour when there is no disk space left? On Linux, there is a special device /dev/full. This article describes how to make something similar on macOS.
Project link: https://www.thedroidsonroids.com/blog/dev-full-osx