From 7c8ce5f32feb970f1842e6859a8c74f6cb86cfe8 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 29 Jun 2025 12:17:26 -0400 Subject: Add bats tests --- .gitmodules | 12 ++++++++ tests/justify.bats | 77 +++++++++++++++++++++++++++++++++++++++++++++++ tests/vendor/bats-assert | 1 + tests/vendor/bats-core | 1 + tests/vendor/bats-file | 1 + tests/vendor/bats-support | 1 + 6 files changed, 93 insertions(+) create mode 100644 .gitmodules create mode 100644 tests/justify.bats create mode 160000 tests/vendor/bats-assert create mode 160000 tests/vendor/bats-core create mode 160000 tests/vendor/bats-file create mode 160000 tests/vendor/bats-support diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ef84bfb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "tests/vendor/bats-core"] + path = tests/vendor/bats-core + url = https://github.com/bats-core/bats-core.git +[submodule "tests/vendor/bats-assert"] + path = tests/vendor/bats-assert + url = https://github.com/bats-core/bats-assert.git +[submodule "tests/vendor/bats-file"] + path = tests/vendor/bats-file + url = https://github.com/bats-core/bats-file.git +[submodule "tests/vendor/bats-support"] + path = tests/vendor/bats-support + url = https://github.com/bats-core/bats-support.git diff --git a/tests/justify.bats b/tests/justify.bats new file mode 100644 index 0000000..6fac7ef --- /dev/null +++ b/tests/justify.bats @@ -0,0 +1,77 @@ +#!/usr/bin/env bats + +load 'vendor/bats-support/load' +load 'vendor/bats-assert/load' +load 'vendor/bats-file/load' + +JUSTIFY_BIN="./build/justify" + +@test "last line of the output is left aligned" { + run "${JUSTIFY_BIN}" <