Add test package

This commit is contained in:
2017-10-12 07:41:35 +02:00
parent fdf902c755
commit e316631f6e
5 changed files with 146 additions and 99 deletions

View File

@ -36,6 +36,11 @@ import tanya.meta.transform;
import tanya.range.array;
import tanya.range.primitive;
version (unittest)
{
import tanya.test.assertion;
}
/**
* Thrown on encoding errors.
*/
@ -612,17 +617,7 @@ struct String
@nogc pure @safe unittest
{
UTFException exception;
try
{
auto s = String(1, cast(wchar) 0xd900);
}
catch (UTFException e)
{
exception = e;
}
assert(exception !is null);
defaultAllocator.dispose(exception);
assertThrown!UTFException(() => String(1, cast(wchar) 0xd900));
}
/// ditto
@ -648,17 +643,7 @@ struct String
@nogc pure @safe unittest
{
UTFException exception;
try
{
auto s = String(1, cast(dchar) 0xd900);
}
catch (UTFException e)
{
exception = e;
}
assert(exception !is null);
defaultAllocator.dispose(exception);
assertThrown!UTFException(() => String(1, cast(dchar) 0xd900));
}
/**