]> git.draconx.ca Git - dxcommon.git/blobdiff - tests/macros.at
Avoid nonportable ${x##y} substitutions in program tests.
[dxcommon.git] / tests / macros.at
index 07d23ca4b76d312b9a7e87461e6c403f97aae5c6..f746e54522ae8e849d0fab932ff6b044dc1eddf5 100644 (file)
@@ -235,3 +235,34 @@ MOFILES = @&t@
 ]])
 
 AT_CLEANUP
+
+AT_SETUP([DX_BASENAME])
+AT_KEYWORDS([DX_BASENAME macro])
+
+AT_DATA([test.in], [[@base0@
+@base1@
+@base2@
+@base3@
+]])
+
+TEST_CONFIGURE_AC(
+[[DX_BASENAME([base0], ["hello"])
+DX_BASENAME([base1], ["foo/bar"])
+DX_BASENAME([base2], ["/foo/bar/baz"])
+DX_BASENAME([base3], ["hello world"])
+AC_SUBST([base0])
+AC_SUBST([base1])
+AC_SUBST([base2])
+AC_SUBST([base3])
+AC_CONFIG_FILES([test])
+]])
+TEST_AUTORECONF
+
+TEST_CONFIGURE
+AT_CHECK([cat test], [0], [hello
+bar
+baz
+hello world
+])
+
+AT_CLEANUP