ceylon/ceylon.language — Issue #37: Expected behavior of Singleton.segment
Author: chochos
Created: 2012-01-21 04:02:25+00:00
State: open

There are some assertions in the tests for Singleton.segment that indicate unintuitive behavior of Singleton.behavior, as well as contradictory ones:

assert(nonempty singleton.segment(0, 1), "nonempty singleton segment(0,1)");
assert(!nonempty singleton.segment(0, 0), "!nonempty singleton segment(0,0)");
assert(!nonempty singleton.segment(0, 1), "!nonempty singleton segment(0,1)");
assert(nonempty singleton.segment(0, -1), "nonempty singleton segment(0,-1)");

The first two are contradictory. I think the first one should is the correct one and the second one should be removed.
The third one should not be negated; I think singleton.segment(0,1) should be nonempty.
The fourth one, I think we had established that negative lengths for segment would return empty.