diff options
| author | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:03:16 +0900 |
|---|---|---|
| committer | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:03:16 +0900 |
| commit | d40cbda03a10559cbd8a8ae3ac3566d6fa94b7f8 (patch) | |
| tree | 7f9d3b9d19d5ca12dc36a45f31f0562a342e0ad4 /t/interpolate | |
| download | blosxom-master.tar.gz blosxom-master.zip | |
Import blosxom-2.2.0.tar.gzHEADlocal/blosxommaster
Diffstat (limited to 't/interpolate')
| -rw-r--r-- | t/interpolate/config/blosxom.conf | 29 | ||||
| -rw-r--r-- | t/interpolate/data/content_type.html | 1 | ||||
| -rw-r--r-- | t/interpolate/data/date.html | 1 | ||||
| -rw-r--r-- | t/interpolate/data/foot.html | 2 | ||||
| -rw-r--r-- | t/interpolate/data/head.html | 28 | ||||
| -rw-r--r-- | t/interpolate/data/story.html | 3 | ||||
| -rw-r--r-- | t/interpolate/expected.html | 32 | ||||
| -rw-r--r-- | t/interpolate/spec.yaml | 4 |
8 files changed, 100 insertions, 0 deletions
diff --git a/t/interpolate/config/blosxom.conf b/t/interpolate/config/blosxom.conf new file mode 100644 index 0000000..9daf90f --- /dev/null +++ b/t/interpolate/config/blosxom.conf @@ -0,0 +1,29 @@ +$blog_title = 'Interpolation Testing'; +$blog_description = 'Terpolation Turpentine'; +$datadir = "$ENV{BLOSXOM_CONFIG_DIR}/../data"; +use vars qw(%hash $hashref $hash); +%hash = ( + abc => 123, + def => 456, + 'X-Factor' => 789, +); +$hashref = { + abc => 123, + def => 456, + 'X-Factor' => 789, +}; +$Blosxom::Test::string = 'this is a test'; +%Blosxom::Test::hash = ( + abc => 123, + def => 456, + 'X-Factor' => 789, +); +$Blosxom::Test::hashref = { + abc => 123, + def => 456, + 'X-Factor' => 789, +}; +# Silence $hash warnings +$hash = ''; + +1; diff --git a/t/interpolate/data/content_type.html b/t/interpolate/data/content_type.html new file mode 100644 index 0000000..e81f92a --- /dev/null +++ b/t/interpolate/data/content_type.html @@ -0,0 +1 @@ +text/xhtml; charset=UTF-8 diff --git a/t/interpolate/data/date.html b/t/interpolate/data/date.html new file mode 100644 index 0000000..2cdf76d --- /dev/null +++ b/t/interpolate/data/date.html @@ -0,0 +1 @@ + <h3>$yr-$mo_num-$da</h3> diff --git a/t/interpolate/data/foot.html b/t/interpolate/data/foot.html new file mode 100644 index 0000000..308b1d0 --- /dev/null +++ b/t/interpolate/data/foot.html @@ -0,0 +1,2 @@ +</body> +</html> diff --git a/t/interpolate/data/head.html b/t/interpolate/data/head.html new file mode 100644 index 0000000..3984681 --- /dev/null +++ b/t/interpolate/data/head.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> +</head> +<body> +<pre> +# Basic scalars +title: $blog_title +description: $blosxom::blog_description +# Namespaced scalars +Blosxom::Test::string: $Blosxom::Test::string +# Hash values +hash{abc}: $hash{abc} +hash{'X-Factor'}: $hash{'X-Factor'} +blosxom::hash{def}: $blosxom::hash{def} +blosxom::hash{"X-Factor"}: $blosxom::hash{"X-Factor"} +hashref->{abc}: $hashref->{abc} +blosxom::hashref->{def}: $blosxom::hashref->{def} +Blosxom::Test::hash{abc}: $Blosxom::Test::hash{abc} +Blosxom::Test::hash{'X-Factor'}: $Blosxom::Test::hash{'X-Factor'} +Blosxom::Test::hashref->{def}: $Blosxom::Test::hashref->{def} +Blosxom::Test::hashref->{"X-Factor"}: $Blosxom::Test::hashref->{"X-Factor"} +# Bad quoting with hash values +hash{'X-Factor}: $hash{'X-Factor} +hash{X-Factor'}: $hash{X-Factor'} +hash{"X-Factor'}: $hash{"X-Factor'} +</pre> diff --git a/t/interpolate/data/story.html b/t/interpolate/data/story.html new file mode 100644 index 0000000..7f3d068 --- /dev/null +++ b/t/interpolate/data/story.html @@ -0,0 +1,3 @@ + <h4><a name="$fn">$title</a></h4> + <div>$body</div> + <p>posted at: $ti | path: <a href="$url$path">$path </a> | <a href="$url/$yr/$mo_num/$da#$fn">permanent link to this entry</a></p> diff --git a/t/interpolate/expected.html b/t/interpolate/expected.html new file mode 100644 index 0000000..f9c8598 --- /dev/null +++ b/t/interpolate/expected.html @@ -0,0 +1,32 @@ +Content-Type: text/xhtml; charset=UTF-8
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> +</head> +<body> +<pre> +# Basic scalars +title: Interpolation Testing +description: Terpolation Turpentine +# Namespaced scalars +Blosxom::Test::string: this is a test +# Hash values +hash{abc}: 123 +hash{'X-Factor'}: 789 +blosxom::hash{def}: 456 +blosxom::hash{"X-Factor"}: 789 +hashref->{abc}: 123 +blosxom::hashref->{def}: 456 +Blosxom::Test::hash{abc}: 123 +Blosxom::Test::hash{'X-Factor'}: 789 +Blosxom::Test::hashref->{def}: 456 +Blosxom::Test::hashref->{"X-Factor"}: 789 +# Bad quoting with hash values +hash{'X-Factor}: {'X-Factor} +hash{X-Factor'}: {X-Factor'} +hash{"X-Factor'}: {"X-Factor'} +</pre> +</body> +</html> diff --git a/t/interpolate/spec.yaml b/t/interpolate/spec.yaml new file mode 100644 index 0000000..93883d3 --- /dev/null +++ b/t/interpolate/spec.yaml @@ -0,0 +1,4 @@ +tests: + - + - "" + - expected.html |
