summaryrefslogtreecommitdiff
path: root/libmisc/tests/test_obj_autobox.c.gen
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-08 04:02:52 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-06-08 04:02:52 -0600
commitef5956962675d7cb1bdb76a2fc45760b002a570c (patch)
tree54fa10580413b4b1dfbd9b22a52fffca834f772e /libmisc/tests/test_obj_autobox.c.gen
parent53d0b11262177cd212803fc9330e055871c348b3 (diff)
parentdb1b4b4cc41c84ec4c8e11418431a1ab2a1001c5 (diff)
Merge branch 'lukeshu/fix-obj-box'
Diffstat (limited to 'libmisc/tests/test_obj_autobox.c.gen')
-rwxr-xr-xlibmisc/tests/test_obj_autobox.c.gen17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmisc/tests/test_obj_autobox.c.gen b/libmisc/tests/test_obj_autobox.c.gen
new file mode 100755
index 0000000..3cfa3d4
--- /dev/null
+++ b/libmisc/tests/test_obj_autobox.c.gen
@@ -0,0 +1,17 @@
+#!/bin/sh
+# libmisc/tests/test_obj_autobox.c.gen - Generate tests for LO_BOX()
+#
+# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com>
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+infile=$1
+outfile=$2
+
+grep --quiet lo_box_ -- "$infile"
+
+{
+ echo "/* ${outfile} - Generated by \`$*\`. DO NOT EDIT! */"
+ sed -E 's/lo_box_([a-z0-9_]+)_as_([a-z0-9_]+)\(/LO_BOX(\2, /g' <"$infile"
+} >"$outfile"
+
+! grep -H lo_box_ -- "$outfile"