From 20ac878202202a8f7271f367c961b99319deabdc Mon Sep 17 00:00:00 2001 From: volodya-lombrozo Date: Sat, 31 Aug 2024 09:49:52 +0300 Subject: [PATCH] feat(#432): prove that opeo keeps packages --- .../opeo/decompilation/WithoutAliasesTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/org/eolang/opeo/decompilation/WithoutAliasesTest.java b/src/test/java/org/eolang/opeo/decompilation/WithoutAliasesTest.java index 19f1f637..cbc81287 100644 --- a/src/test/java/org/eolang/opeo/decompilation/WithoutAliasesTest.java +++ b/src/test/java/org/eolang/opeo/decompilation/WithoutAliasesTest.java @@ -49,6 +49,15 @@ void removesAllAliases() { ); } + @Test + void keepsPackage() { + MatcherAssert.assertThat( + "We expect that package is kept, even if the program doesn't have labels or opcodes", + new WithoutAliases(WithoutAliasesTest.program()).toXml(), + XhtmlMatchers.hasXPath("/program/metas/meta[head='package']") + ); + } + @Test void removesOnlyLabelAlias() { MatcherAssert.assertThat( @@ -117,6 +126,14 @@ private static XML program(final Directives... objects) { new Directives() .add("program") .add("metas") + .append( + new Directives() + .add("meta") + .add("head").set("package").up() + .add("tail").set("org.eolang.opeo").up() + .add("part").set("org.eolang.opeo").up() + .up() + ) .append(WithoutAliasesTest.alias("org.eolang.jeo.label")) .append(WithoutAliasesTest.alias("org.eolang.jeo.opcode")) .up()