#include "stdafx.h"

#include <iostream>
#include <string>

#include <stlsoft/simple_string.hpp>
#include <softsteel/string_algo.hpp>

#include <cassert>

template<typename char_type>
void run_test(char_type const* test, size_t cch, char_type const* cmp)
{
	typedef stlsoft_ns_qual(basic_string_view)<char_type> string_view;

	char_type const* cp = test;
	string_view test0 = softsteel::right_view(cp, cch);
	assert(test0 == cmp);

	std::basic_string<char_type> stdstr(cp);
	string_view test1 = softsteel::right_view(stdstr, cch);
	assert(test1 == cmp);

	stlsoft_ns_qual(basic_simple_string)<char_type> sstr(cp);
	string_view test2 = softsteel::right_view(sstr, cch);
	assert(test2 == cmp);
}

int main(int argc, char* argv[])
{
	run_test("my test string", 6, "string");
	run_test(L"my test string", 6, L"string");

	return 0;
}
