Skip to content

Commit

Permalink
objectionary#2834 add working test for seq
Browse files Browse the repository at this point in the history
  • Loading branch information
c71n93 committed Feb 7, 2024
1 parent 03c1836 commit a46e0ca
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions eo-runtime/src/test/java/EOorg/EOeolang/EOseqTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,52 @@ public void calculatesWithTupleAndReturnsObject() {
Matchers.equalTo(1L)
);
}

/**
* Test
*
* [] > parent
* memory 0 > counter
* seq > @
* *
* counter.write (counter.as-int.plus 1)
* counter.as-int
*
* @since 1.0
*/
@Disabled
@Test
public void calculatesWithoutTupleAndReturnsObject() {
final Phi counter = new EOmemory(Phi.Φ);
counter.attr(0).put(new Data.ToPhi(0L));
final Phi increment = new PhWith(
new PhCopy(new PhMethod(counter, "write")),
0,
new PhWith(
new PhCopy(new PhMethod(new PhMethod(counter, "as-int"), "plus")),
0, new Data.ToPhi(1L)
)
);
final Phi args = new PhWith(
new PhCopy(
new PhMethod(
new PhWith(
new PhCopy(
new PhMethod(new EOtuple$EOempty(Phi.Φ), "with")
),
0,
increment
),
"with"
)
),
0, new PhMethod(counter, "as-int")
);
MatcherAssert.assertThat(
new Dataized(
new PhWith(new EOseq(Phi.Φ), 0, args)
).take(Long.class),
Matchers.equalTo(1L)
);
}
}

0 comments on commit a46e0ca

Please sign in to comment.