module test;

import std.stdio;

import strex;


int main(char[][] args)
{

	char[] msg = "this <test> is <advanced, as <you can> see>a<b<c>d>><e";
	writefln("Test - custom, string: " ~ msg);
	char[][] result = findNesting(msg, '<', '>');
	foreach(v; result)
		writefln("match: " ~ v);

	assert( result[0] == "test" );
	assert( result[1] == "advanced, as <you can> see" );
	assert( result[2] == "you can" );
	assert( result[3] == "b<c>d" );
	assert( result[4] == "c" );

	assert(containsTag("hallo", '<', '>') == false);
	assert(containsTag("h<allo", '<', '>') == false);
	assert(containsTag("h<al<lo", '<', '>') == false);
	assert(containsTag("ha>llo", '<', '>') == false);
	assert(containsTag("h>all>o", '<', '>') == false);
	assert(containsTag("h>all<o", '<', '>') == false);
	assert(containsTag("h>all>o<", '<', '>') == false);
	assert(containsTag("h>al<l<o", '<', '>') == false);
	assert(containsTag("h<al>lo", '<', '>') == true);
	assert(containsTag("h<al<lo>", '<', '>') == true);
	assert(containsTag("h>a<ll>o", '<', '>') == true);
	
	return 0;
}

