+2001-09-18 Paul Wagland <paul@wagland.net>
+
+ * tests/m4sh.at: Ensure that AS_DIRNAME handles '/', '//' and '///'
+ correctly.
+ Add test for AS_BASENAME.
+ * lib/m4sugar/m4sh.m4: Fix AS_BASENAME so that it passes the previous
+ added test. It now correctly handles /1/2/3/, returning '3' not ''.
+ Added AS_BASENAME_SED to make the interface the same as AS_DIRNAME.
+ * tests/base.at: Fixed the expected responses. The old ones were
+ one line out...
+ * lib/autoconf/general.m4: Fixed AC_PREFIX_PROGRAM, it now behaves as
+ the documentation claims it should (and how it behaved in 2.13).
+
2001-09-18 Akim Demaille <akim@epita.fr>
* lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): No INIT-CMDS in
]])
AT_CHECK_AUTOCONF([], 0, [],
-[configure.ac:18: warning: SINGLE_TEST invoked multiple times
-configure.ac:19: warning: SINGLE_TEST invoked multiple times
+[configure.ac:17: warning: SINGLE_TEST invoked multiple times
+configure.ac:18: warning: SINGLE_TEST invoked multiple times
])
AT_CHECK_CONFIGURE
]])
AT_CHECK_AUTOCONF([], 0, [],
-[configure.ac:17: warning: SINGLE_TEST invoked multiple times
+[configure.ac:16: warning: SINGLE_TEST invoked multiple times
])
AT_CHECK_CONFIGURE
test "$dir" = "$2" ||
echo "dirname_sed($1) = $dir instead of $2" >&2])
+DIRNAME_TEST([/], [/])
+DIRNAME_TEST([//], [//])
+DIRNAME_TEST([///], [/])
DIRNAME_TEST([//1], [//])
DIRNAME_TEST([/1], [/])
DIRNAME_TEST([./1], [.])
+## ------------------------------- ##
+## AS_BASENAME & AS_BASENAME_SED. ##
+## ------------------------------- ##
+
+# Build nested dirs.
+m4_pattern_allow([^AS_BASENAME(_SED)?$])
+AT_SETUP([[AS_BASENAME & AS_BASENAME_SED]])
+
+AT_DATA([configure.ac],
+[[AC_PLAIN_SCRIPT()#! /bin/sh
+
+_AS@&t@_EXPR_PREPARE
+
+m4_define([BASENAME_TEST],
+[base=`AS_BASENAME([$1])`
+test "$base" = "$2" ||
+ echo "basename($1) = $base instead of $2" >&2
+
+base=`AS_BASENAME_SED([$1])`
+test "$base" = "$2" ||
+ echo "basename_sed($1) = $base instead of $2" >&2])
+
+BASENAME_TEST([//1], [1])
+BASENAME_TEST([/1], [1])
+BASENAME_TEST([./1], [1])
+BASENAME_TEST([../../2], [2])
+BASENAME_TEST([//1/], [1])
+BASENAME_TEST([/1/], [1])
+BASENAME_TEST([./1/], [1])
+BASENAME_TEST([../../2], [2])
+BASENAME_TEST([//1/3], [3])
+BASENAME_TEST([/1/3], [3])
+BASENAME_TEST([./1/3], [3])
+BASENAME_TEST([../../2/3], [3])
+BASENAME_TEST([//1/3///], [3])
+BASENAME_TEST([/1/3///], [3])
+BASENAME_TEST([./1/3///], [3])
+BASENAME_TEST([../../2/3///], [3])
+BASENAME_TEST([//1//3/], [3])
+BASENAME_TEST([/1//3/], [3])
+BASENAME_TEST([./1//3/], [3])
+BASENAME_TEST([a.c], [a.c])
+BASENAME_TEST([a.c/], [a.c])
+BASENAME_TEST([/a.c/], [a.c])
+BASENAME_TEST([/1/a.c], [a.c])
+BASENAME_TEST([/1/a.c/], [a.c])
+BASENAME_TEST([/1/../a.c], [a.c])
+BASENAME_TEST([/1/../a.c/], [a.c])
+BASENAME_TEST([./1/a.c], [a.c])
+BASENAME_TEST([./1/a.c/], [a.c])
+AS_EXIT(0)
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP(configure)
+
+
+
## ------------ ##
## AS_MKDIR_P. ##
## ------------ ##