mirror of
https://github.com/dlang/phobos.git
synced 2025-05-08 20:19:43 +03:00
boyerMooreFinder and the find specializations using it should be @safe
This commit is contained in:
parent
e8c7699aa3
commit
a8a98fe57e
1 changed files with 4 additions and 4 deletions
|
@ -5698,7 +5698,7 @@ Range1 find(Range1, alias pred, Range2)(
|
||||||
return needle.beFound(haystack);
|
return needle.beFound(haystack);
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
debug(std_algorithm) scope(success)
|
debug(std_algorithm) scope(success)
|
||||||
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
|
writeln("unittest @", __FILE__, ":", __LINE__, " done.");
|
||||||
|
@ -5718,7 +5718,7 @@ unittest
|
||||||
assert(find(b, boyerMooreFinder(a)).empty);
|
assert(find(b, boyerMooreFinder(a)).empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
auto bm = boyerMooreFinder("for");
|
auto bm = boyerMooreFinder("for");
|
||||||
auto match = find("Moor", bm);
|
auto match = find("Moor", bm);
|
||||||
|
@ -5781,7 +5781,7 @@ if (isInputRange!InputRange)
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
auto arr = [ 1, 2, 3, 4, 1 ];
|
auto arr = [ 1, 2, 3, 4, 1 ];
|
||||||
assert(find!("a > 2")(arr) == [ 3, 4, 1 ]);
|
assert(find!("a > 2")(arr) == [ 3, 4, 1 ]);
|
||||||
|
@ -5822,7 +5822,7 @@ if (isForwardRange!R1 && isForwardRange!R2
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
string s = "abcdef";
|
string s = "abcdef";
|
||||||
assert(findSkip(s, "cd") && s == "ef");
|
assert(findSkip(s, "cd") && s == "ef");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue