summaryrefslogtreecommitdiff
path: root/cpan/Module-Build/t/mbyaml.t
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2009-11-28 23:45:10 -0600
committerSteve Peters <steve@fisharerojo.org>2009-11-28 23:45:10 -0600
commita917e5da001c2e01ede95e432a105b1aa899f1e5 (patch)
treeb4e92d0c2636de6d398aa65df051a2f438d73929 /cpan/Module-Build/t/mbyaml.t
parentff868e665bf85a829dc47bfa1243b26d4367cacd (diff)
parent23e33b604408d78c7993c7ba35b0a4323eb9feeb (diff)
downloadperl-a917e5da001c2e01ede95e432a105b1aa899f1e5.tar.gz
Merge branch 'blead' of ssh://stevep@perl5.git.perl.org/gitroot/perl into blead
Diffstat (limited to 'cpan/Module-Build/t/mbyaml.t')
-rw-r--r--cpan/Module-Build/t/mbyaml.t262
1 files changed, 0 insertions, 262 deletions
diff --git a/cpan/Module-Build/t/mbyaml.t b/cpan/Module-Build/t/mbyaml.t
deleted file mode 100644
index d2cb0d547f..0000000000
--- a/cpan/Module-Build/t/mbyaml.t
+++ /dev/null
@@ -1,262 +0,0 @@
-#!/usr/local/bin/perl -w
-
-use strict;
-use lib 't/lib';
-use MBTest 'no_plan';
-
-use_ok 'Module::Build::YAML';
-ensure_blib('Module::Build::YAML');
-
-my ($dir);
-$dir = ".";
-$dir = "t" if (-d "t");
-
-{
- my ($expected, $got, $var);
- ##########################################################
- # Test a typical-looking Module::Build structure (alphabetized)
- ##########################################################
- $var = {
- 'resources' => {
- 'license' => 'http://opensource.org/licenses/artistic-license.php'
- },
- 'meta-spec' => {
- 'version' => '1.2',
- 'url' => 'http://module-build.sourceforge.net/META-spec-v1.2.html'
- },
- 'generated_by' => 'Module::Build version 0.2709',
- 'version' => '0.13',
- 'name' => 'js-app',
- 'dynamic_config' => '1',
- 'author' => [
- '"Stephen Adkins" <spadkins@gmail.com>'
- ],
- 'license' => 'lgpl',
- 'build_requires' => {
- 'App::Build' => '0',
- 'File::Spec' => '0',
- 'Module::Build' => '0'
- },
- 'provides' => {
- 'JavaScript::App' => {
- 'version' => '0',
- 'file' => 'lib/JavaScript/App.pm'
- }
- },
- 'requires' => {
- 'App::Options' => '0'
- },
- 'abstract' => 'A framework for building dynamic widgets or full applications in Javascript'
- };
- $expected = <<'EOF';
----
-abstract: A framework for building dynamic widgets or full applications in Javascript
-author:
- - '"Stephen Adkins" <spadkins@gmail.com>'
-build_requires:
- App::Build: 0
- File::Spec: 0
- Module::Build: 0
-dynamic_config: 1
-generated_by: Module::Build version 0.2709
-license: lgpl
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-name: js-app
-provides:
- JavaScript::App:
- file: lib/JavaScript/App.pm
- version: 0
-requires:
- App::Options: 0
-resources:
- license: http://opensource.org/licenses/artistic-license.php
-version: 0.13
-EOF
- $got = &Module::Build::YAML::Dump($var);
- is($got, $expected, "Dump(): single deep hash");
-
- ##########################################################
- # Test a typical-looking Module::Build structure (ordered)
- ##########################################################
- $expected = <<'EOF';
----
-name: js-app
-version: 0.13
-author:
- - '"Stephen Adkins" <spadkins@gmail.com>'
-abstract: A framework for building dynamic widgets or full applications in Javascript
-license: lgpl
-resources:
- license: http://opensource.org/licenses/artistic-license.php
-requires:
- App::Options: 0
-build_requires:
- App::Build: 0
- File::Spec: 0
- Module::Build: 0
-dynamic_config: 1
-provides:
- JavaScript::App:
- file: lib/JavaScript/App.pm
- version: 0
-generated_by: Module::Build version 0.2709
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-EOF
- $var->{_order} = [qw(name version author abstract license resources requires build_requires dynamic_config provides)];
- $got = &Module::Build::YAML::Dump($var);
- is($got, $expected, "Dump(): single deep hash, ordered");
-
- ##########################################################
- # Test that an array turns into multiple documents
- ##########################################################
- $var = [
- "e",
- 2.71828,
- [ "pi", "is", 3.1416 ],
- { fun => "under_sun", 6 => undef, "more", undef },
- ];
- $expected = <<'EOF';
----
-e
----
-2.71828
----
-- pi
-- is
-- 3.1416
----
-6: ~
-fun: under_sun
-more: ~
-EOF
- $got = &Module::Build::YAML::Dump(@$var);
- is($got, $expected, "Dump(): multiple, various");
-
- ##########################################################
- # Test that a single array ref turns into one document
- ##########################################################
- $expected = <<'EOF';
----
-- e
-- 2.71828
--
- - pi
- - is
- - 3.1416
--
- 6: ~
- fun: under_sun
- more: ~
-EOF
- $got = &Module::Build::YAML::Dump($var);
- is($got, $expected, "Dump(): single array of various");
-
- ##########################################################
- # Test Object-Oriented Flavor of the API
- ##########################################################
- my $y = Module::Build::YAML->new();
- $got = $y->Dump($var);
- is($got, $expected, "Dump(): single array of various (OO)");
-
- ##########################################################
- # Test Quoting Conditions (newlines, quotes, tildas, undefs)
- ##########################################################
- $var = {
- 'foo01' => '`~!@#$%^&*()_+-={}|[]\\;\':",./?<>
-<nl>',
- 'foo02' => '~!@#$%^&*()_+-={}|[]\\;:,./<>?',
- 'foo03' => undef,
- 'foo04' => '~',
- };
- $expected = <<'EOF';
----
-foo01: "`~!@#$%^&*()_+-={}|[]\;':\",./?<>\n<nl>"
-foo02: "~!@#$%^&*()_+-={}|[]\;:,./<>?"
-foo03: ~
-foo04: "~"
-EOF
- $got = &Module::Build::YAML::Dump($var);
- is($got, $expected, "Dump(): tricky embedded characters");
-
- $var = {
- 'foo10' => undef,
- 'foo40' => '!',
- 'foo41' => '@',
- 'foo42' => '#',
- 'foo43' => '$',
- 'foo44' => '%',
- 'foo45' => '^',
- 'foo47' => '&',
- 'foo48' => '*',
- 'foo49' => '(',
- 'foo50' => ')',
- 'foo51' => '_',
- 'foo52' => '+',
- 'foo53' => '-',
- 'foo54' => '=',
- 'foo55' => '{',
- 'foo56' => '}',
- 'foo57' => '|',
- 'foo58' => '[',
- 'foo59' => ']',
- 'foo60' => '\\',
- 'foo61' => ';',
- 'foo62' => ':',
- 'foo63' => ',',
- 'foo64' => '.',
- 'foo65' => '/',
- 'foo66' => '<',
- 'foo67' => '>',
- 'foo68' => '?',
- 'foo69' => '\'',
- 'foo70' => '"',
- 'foo71' => '`',
- 'foo72' => '
-',
- };
- $expected = <<'EOF';
----
-foo10: ~
-foo40: "!"
-foo41: '@'
-foo42: "#"
-foo43: $
-foo44: %
-foo45: "^"
-foo47: "&"
-foo48: "*"
-foo49: "("
-foo50: ")"
-foo51: _
-foo52: +
-foo53: -
-foo54: =
-foo55: "{"
-foo56: "}"
-foo57: "|"
-foo58: "["
-foo59: "]"
-foo60: \
-foo61: ;
-foo62: :
-foo63: ,
-foo64: .
-foo65: /
-foo66: '<'
-foo67: '>'
-foo68: "?"
-foo69: "'"
-foo70: '"'
-foo71: "`"
-foo72: "\n"
-EOF
- $got = &Module::Build::YAML::Dump($var);
- is($got, $expected, "Dump(): tricky embedded characters (singles)");
-
-}
-
-