From: Ben Pfaff Date: Wed, 15 Jun 2011 05:38:13 +0000 (-0700) Subject: CD: Fix a bug and add a regression test. X-Git-Tag: v0.7.9~282 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48bf7bfe2e8398dd26bbab9d8194bda6061fd4aa;p=pspp-builds.git CD: Fix a bug and add a regression test. --- diff --git a/src/language/utilities/cd.c b/src/language/utilities/cd.c index cae84eb3..d28c0a30 100644 --- a/src/language/utilities/cd.c +++ b/src/language/utilities/cd.c @@ -48,6 +48,7 @@ cmd_cd (struct lexer *lexer, struct dataset *ds UNUSED) } free (path); + lex_get (lexer); return CMD_SUCCESS; diff --git a/tests/automake.mk b/tests/automake.mk index d02c59fe..61c7996f 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -316,6 +316,7 @@ TESTSUITE_AT = \ tests/language/stats/sort-cases.at \ tests/language/stats/t-test.at \ tests/language/utilities/cache.at \ + tests/language/utilities/cd.at \ tests/language/utilities/date.at \ tests/language/utilities/insert.at \ tests/language/utilities/permissions.at \ diff --git a/tests/language/utilities/cd.at b/tests/language/utilities/cd.at new file mode 100644 index 00000000..f56f1b88 --- /dev/null +++ b/tests/language/utilities/cd.at @@ -0,0 +1,13 @@ +AT_BANNER([CD]) + +AT_SETUP([CD]) +mkdir subdir +AT_DATA([cd.sps], [dnl +cd 'subdir'. +host command=[['pwd > mydir']]. +]) +AT_CHECK([pspp -O format=csv cd.sps]) +AT_CAPTURE_FILE([subdir/mydir]) +AT_CHECK([sed 's,.*/,,' subdir/mydir], [0], [subdir +]) +AT_CLEANUP