Arch::Test::Tree(3pm)

πŸ“¦ version 0.5.2, in ubuntu jammy

πŸ’– Arch::Test::Tree πŸ’–

okay bestie, welcome to the Arch::Test::Tree page β€” it's part of the Perl docs (the user-contributed corner of the manual, section 3pm, iykyk). this is where you go when you wanna spin up fake Arch project trees for testing, fast. no cap. πŸŽ€


✨ NAME ✨

Arch::Test::Tree β€” a test framework for Arch-Perl. periodt. πŸ’…


🌸 SYNOPSIS 🌸

like, here's the vibe:

use Arch::Test::Framework;

my $fw = Arch::Test::Framework->new;
my $tree = $fw->make_tree($dir, $version);

my $dir = $tree->add_dir;
$tree->add_file($dir);
$tree->import;

that's literally it. go off. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

Arch::Test::Tree gives you methods to quickly build and modify Arch project trees inside the Arch::Test framework. it's giving scaffolding. it's giving test-harness energy. it's giving "i need a whole fake project tree and i need it now". πŸ’–


πŸ‘‘ METHODS πŸ‘‘

here's the full roster, bestie β€” no skips, no cuts:

new, root, framework, run_tla, add_file, add_dir, add_link, modify_file, rename_file, rename_dir, remove_file, remove_dir, inventory, import, commit.


🌈 new [framework] [path]

creates a brand new Arch::Test::Tree instance for path.

⚠️ bestie, do not call this directly. it's a backstage method. let the framework handle it, fr fr. 🫢

🌟 root

returns the project tree's root directory. the home base. the main character location. 🏠


πŸ’œ framework

returns the associated Arch::Test::Framework reference. it's the friend the tree came with. πŸ«‚


🧚 run_tla @args

runs tla @args from the tree root. yes, straight from the root. slay. ✨


πŸ“ add_file [dir [name [content]]]

adds a new file called name in the directory dir, and fills it with content. iconic file creation moment. πŸ“„

  • dir defaults to the project root (".").
  • if name isn't specified, a unique filename gets generated for you. ✨
  • if you don't give it content, a default content gets generated. boom.

πŸŽ€ add_dir [parent [name]]

adds a new directory under parent, or under "." if parent isn't specified. if name is not given, a unique name gets generated. directory debut, honestly. πŸ“


adds a new symbolic link under parent, or under "." if parent isn't specified. if name is not given, a unique name gets generated. and if target is omitted, a (probably) non-existing target gets generated. πŸ’€ (yeah, "probably". we said what we said.)


πŸ’… modify_file file [content]

changes file's content to content. and if you don't pass new content? it appends Has been modified. β€” no cap, that's the literal default. πŸ“


🌸 rename_file old new

renames file old to new. returns new. glow-up complete. ✨


🌈 rename_dir old new

renames directory old to new. returns new. same glow-up, but for a folder. πŸ“‚


πŸ”₯ remove_file file

deletes file and its associated arch id. it's not just the file, bestie. the arch id goes too. πŸ’€


πŸ’€ remove_dir dir

recursively deletes dir and its content. recursively. everything inside. gone. dramatic but accurate. 🫑


⭐ inventory [flags]

returns the inventory as generated by running tla inventory flags.

flags default to -Bs if you don't specify them. 🌟


🫢 import [summary [log]]

creates a "base-0" revision from the tree, using summary as the summary line and log as the log text.

if the tree already contains a log file, summary and log can both be omitted. convenient, right? 😌


πŸ‘‘ commit [summary [log]]

commits a "patch-n" revision from the tree, using summary as the summary line and log as the log text.

and yep β€” if the tree contains a log file, summary and log can be omitted here too. πŸŽ‰


πŸ’– AUTHORS πŸ’–

  • Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
  • Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).

absolute legends. we stan. πŸ‘‘


and that's the whole page, bestie!! this was Arch::Test::Tree(3pm), from perl v5.20.2, dated 2005-04-14 β€” yes she's an elder but she still ate πŸ’…βœ¨ mwah, go build some trees πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from