#include "lgi/common/Lgi.h"
#include "lgi/common/UnicodeString.h"

static uint8_t u8[] = {
	'T','h','i','s',' ','i','s',' ','s','o','m','e',' ','a','s','c','i','i',' ',
	0xE1,0x9A,0xA0,0xE1,0x9B,0x87,0xE1,0x9A,0xBB,0xE1,0x9B,0xAB,0xE1,0x9B,0x92,0xE1,0x9B,0xA6,0xE1,0x9A,0xA6,0xE1,0x9B,0xAB,0xE1,0x9A,0xA0,0xE1,0x9A,0xB1,0xE1,0x9A,
	0xA9,0xE1,0x9A,0xA0,0xE1,0x9A,0xA2,0xE1,0x9A,0xB1,0xE1,0x9B,0xAB,0xE1,0x9A,0xA0,0xE1,0x9B,0x81,0xE1,0x9A,0xB1,0xE1,0x9A,0xAA,0xE1,0x9B,0xAB,0xE1,0x9A,0xB7,0xE1,
	0x9B,0x96,0xE1,0x9A,0xBB,0xE1,0x9A,0xB9,0xE1,0x9B,0xA6,0xE1,0x9B,0x9A,0xE1,0x9A,0xB3,0xE1,0x9A,0xA2,0xE1,0x9B,0x97,0
};

bool LUnicodeString_UnitTests()
{
	LUnicodeString<uint8_t> Utf8(u8);
	auto b = Utf8.Bytes();
	auto w = Utf8.Words();
	auto c = Utf8.Chars();
	LAssert(b == w);
	LAssert(c == 48);

	LUnicodeString<wchar_t> Utf16;
	uint32_t ch;
	while ((ch = *Utf8++))
	{
		*Utf16++ = ch;
	}

	return false;
}
