From 1c57e1d337c00b475253c522461f689e911bc426 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 22 Nov 2008 11:22:01 +0200 Subject: Add some (trivial) macro evaluation tests --- tests/Makefile.am | 1 + tests/rpmmacro.at | 39 +++++++++++++++++++++++++++++++++++++++ tests/rpmtests.at | 1 + 3 files changed, 41 insertions(+) create mode 100644 tests/rpmmacro.at (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index f777640a8..212f7352d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,6 +22,7 @@ TESTSUITE_AT += rpmi.at TESTSUITE_AT += rpmvercmp.at TESTSUITE_AT += rpmconflict.at TESTSUITE_AT += rpmconfig.at +TESTSUITE_AT += rpmmacro.at EXTRA_DIST += $(TESTSUITE_AT) ## testsuite data diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at new file mode 100644 index 000000000..a39c3d50e --- /dev/null +++ b/tests/rpmmacro.at @@ -0,0 +1,39 @@ +# rpmmacro.at: test rpm macros +# + +# ------------------------------ +AT_SETUP([simple rpm --eval]) +AT_CHECK([ +run rpm --define "this that" --eval '%{this}' +], +[0], +[that +]) +AT_CLEANUP + +AT_SETUP([simple true conditional rpm --eval]) +AT_CHECK([ +run rpm --define "this that" --eval '%{?this}' +], +[0], +[that +]) +AT_CLEANUP + +AT_SETUP([simple false conditional rpm --eval]) +AT_CHECK([ +run rpm --define "this that" --eval '%{?that}' +], +[0], +[ +]) +AT_CLEANUP + +AT_SETUP([simple lua --eval]) +AT_CHECK([ +run rpm --eval '%{lua:print(5*5)}' +], +[0], +[25 +]) +AT_CLEANUP diff --git a/tests/rpmtests.at b/tests/rpmtests.at index f18b78928..37c7ec4ed 100644 --- a/tests/rpmtests.at +++ b/tests/rpmtests.at @@ -6,3 +6,4 @@ m4_include([rpmbuild.at]) m4_include([rpmvercmp.at]) m4_include([rpmconflict.at]) m4_include([rpmconfig.at]) +m4_include([rpmmacro.at]) -- cgit v1.2.3