Add tests for relative include paths

This commit is contained in:
Simon Rose
2024-11-14 16:12:35 +01:00
committed by Michael Davidsaver
parent 721e9cc3a7
commit 9fb820b46e
7 changed files with 25 additions and 1 deletions

View File

@ -12,7 +12,7 @@
use strict;
use Test;
BEGIN {plan tests => 12}
BEGIN {plan tests => 14}
# Check include/substitute command model
ok(msi('-I .. ../t1-template.txt'), slurp('../t1-result.txt'));
@ -56,6 +56,12 @@ my %envs = (TEST_NO => 12, PREFIX => 't');
ok(msi('-I. -I.. -S ../t12-substitute.txt'), slurp('../t12-result.txt'));
delete @ENV{ keys %envs }; # Not really needed
# Substitution file, relative path includes
ok(msi('-I @TOP@/modules -S ../t13-substitute.txt'), slurp('../t13-result.txt'));
# Template file, relative path includes
ok(msi('-I @TOP@/modules ../t14-template.txt'), slurp('../t14-result.txt'));
# Test support routines
sub slurp {

View File

@ -0,0 +1,2 @@
# comment line
a=foo

View File

@ -0,0 +1,3 @@
file database/test/ioc/dbtemplate/t13-template.txt {
{ a=foo }
}

View File

@ -0,0 +1,2 @@
# comment line
a=$(a)

View File

@ -0,0 +1 @@
I'm a file!

View File

@ -0,0 +1,5 @@
This is t14-template.txt
I'm a file!
End of t14-template.txt

View File

@ -0,0 +1,5 @@
This is t14-template.txt
include "database/test/ioc/dbtemplate/t14-include.txt"
End of t14-template.txt