diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 894ddd4..55adc4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,35 +146,6 @@ jobs: cd tests bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32 - tests-macos11-gpp: - strategy: - matrix: - os: [macos-11] - compiler: [g++] - version: [10, 11, 12] - name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - name: Run tests - run: | - cd tests - bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} - - tests-macos11-clang: - strategy: - matrix: - os: [macos-11] - compiler: [clang++] - name: Use ${{ matrix.compiler }} on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - name: Run tests - run: | - cd tests - bash ./run.sh ${{ matrix.compiler }} - tests-macos12-gpp: strategy: matrix: diff --git a/tests/test-008_format/files/test-format.cpp b/tests/test-008_format/files/test-format.cpp new file mode 100644 index 0000000..19da939 --- /dev/null +++ b/tests/test-008_format/files/test-format.cpp @@ -0,0 +1,14 @@ +#include "testlib.h" + +using namespace std; + +int main(int argc, char** argv) { + registerGen(argc, argv, 1); + + println(format("%d", 42)); + println(format("hello, %s!", "hat")); + println(format("%s%d!", "'hat'", 42)); + println(format("%s%d!", "'%s'", 42)); + + ensure(format("%f", 42.5).substr(0, 4) == "42.5"); +} diff --git a/tests/test-008_format/refs/test-format/r1/exit_code b/tests/test-008_format/refs/test-format/r1/exit_code new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/test-008_format/refs/test-format/r1/exit_code @@ -0,0 +1 @@ +0 diff --git a/tests/test-008_format/refs/test-format/r1/stderr b/tests/test-008_format/refs/test-format/r1/stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/test-008_format/refs/test-format/r1/stdout b/tests/test-008_format/refs/test-format/r1/stdout new file mode 100644 index 0000000..e0f278f --- /dev/null +++ b/tests/test-008_format/refs/test-format/r1/stdout @@ -0,0 +1,4 @@ +42 +hello, hat! +'hat'42! +'%s'42! diff --git a/tests/test-008_format/refs/test-format/r2/exit_code b/tests/test-008_format/refs/test-format/r2/exit_code new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/test-008_format/refs/test-format/r2/exit_code @@ -0,0 +1 @@ +0 diff --git a/tests/test-008_format/refs/test-format/r2/stderr b/tests/test-008_format/refs/test-format/r2/stderr new file mode 100644 index 0000000..e69de29 diff --git a/tests/test-008_format/refs/test-format/r2/stdout b/tests/test-008_format/refs/test-format/r2/stdout new file mode 100644 index 0000000..e0f278f --- /dev/null +++ b/tests/test-008_format/refs/test-format/r2/stdout @@ -0,0 +1,4 @@ +42 +hello, hat! +'hat'42! +'%s'42! diff --git a/tests/test-008_format/run.sh b/tests/test-008_format/run.sh new file mode 100644 index 0000000..e7aaf4f --- /dev/null +++ b/tests/test-008_format/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -eo pipefail + +bash ../scripts/compile files/test-format.cpp +bash ../scripts/test-ref test-format/r1 ./test-format +bash ../scripts/test-ref test-format/r2 "$VALGRIND" ./test-format +rm -f test-format test-format.exe