Skip to content

docs(examples): add Moose demo with cross-Perl compat check#608

Merged
fglock merged 2 commits intomasterfrom
examples/moose-demo
Apr 29, 2026
Merged

docs(examples): add Moose demo with cross-Perl compat check#608
fglock merged 2 commits intomasterfrom
examples/moose-demo

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Apr 29, 2026

Summary

Adds a self-contained Moose demo under examples/ that doubles as a smoke test for the bundled Moose stack on PerlOnJava.

  • examples/moose.pl — Test::More-style demo with a small forest-ecosystem of animals, exercising:
    • attributes (has) with types, defaults, builders, and lazy
    • inheritance (extends)
    • roles (with, Moose::Role)
    • method modifiers (before / after / around)
    • type constraints (isa)
    • required attributes / predicates / BUILD
    • delegation (handles)
  • examples/test_moose_compat.sh — runs examples/moose.pl under both system perl and ./jperl and asserts the outputs are byte-for-byte identical.

Not part of the automated test suite; intended for demonstration / educational use.

Test plan

  • make (full unit test build) passes
  • bash examples/test_moose_compat.sh reports OK: outputs are identical
  • ./jperl examples/moose.pl produces 7 passing subtests

Generated with Devin

fglock and others added 2 commits April 29, 2026 10:06
Adds examples/moose.pl, a self-contained Test::More-style demo that
exercises a representative slice of Moose features (attributes with
types/defaults/builders/lazy, inheritance, roles, method modifiers,
type constraints, BUILD, delegation) wrapped in a small forest
ecosystem of animals.

Also adds examples/test_moose_compat.sh which runs the demo under both
system perl and ./jperl and asserts the outputs are byte-for-byte
identical, so the demo doubles as a smoke test for the bundled Moose
stack on PerlOnJava.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@fglock fglock merged commit 834d049 into master Apr 29, 2026
2 checks passed
@fglock fglock deleted the examples/moose-demo branch April 29, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant