Every // ---- section banner dies (132 -> 0): names carry the WHAT. Narration deleted (filename restatements, run-with lines, what-the- next-line-does); every ref/hare cite, task cite, divergence, ABI/ layout contract, and ownership qualifier kept (borrowed-view lines restored where the sweep over-cut). Comment-only proven: all 442 walk-workdir .s and 32 import-probe .s byte-identical before/after; libbyteid 56-roster all-ID.
27 lines
1.0 KiB
Plaintext
27 lines
1.0 KiB
Plaintext
// Vectors mirror ref/hare/strings/contains.ha (task #5 @test conversion).
|
|
|
|
package strings_test;
|
|
|
|
import strings;
|
|
|
|
// ref/hare/strings/contains.ha:27.
|
|
|
|
@test fn contains_cases() void = {
|
|
assert(!(!strings.contains("hello world", "hello")));
|
|
assert(!(!strings.contains("hello world", 'h')));
|
|
assert(!( strings.contains("hello world", 'x')));
|
|
assert(!(!strings.contains("hello world", "world")));
|
|
assert(!(!strings.contains("hello world", ""))); // empty hits at 0
|
|
assert(!( strings.contains("hello world", "foobar")));
|
|
assert(!(!strings.contains("こんにちは", 0x306Bu32: rune))); // 'に'
|
|
assert(!(!strings.contains("こんにちは", "ちは")));
|
|
|
|
// Variadic rows. ref/hare/strings/contains.ha:27.
|
|
assert(!( strings.contains("hello")));
|
|
assert(!(!strings.contains("hello world", "world")));
|
|
assert(!(!strings.contains("hello", 'l')));
|
|
assert(!(!strings.contains("hello world", "foo", "world", 'x')));
|
|
assert(!( strings.contains("hello", "foo", 'z', "bar")));
|
|
assert(!(!strings.contains("héllo", "x", 0xE9u32: rune)));
|
|
};
|