
# Test the equal operator
{
	assert(1 == 1);
	assert(1.0 == 1.0);
	assert('--' == '--');
}

# Test assignment.
{
	a = 3;
	assert(a == 3);
}

# Test operations on integers.
{
	assert(4 == +4);
	assert(0-4 == -4);
	assert(1 + 1 == 2);
	assert(2 * 3 == 6);
	assert(6 / 3 == 2);
	assert(4 < 5);
	assert(4 > 3);
	assert(4 <= 5);
	assert(4 <= 4);
	assert(4 >= 3);
	assert(4 == 4);
	assert(4 != 3);
}

# Test operations on floats.
{
	assert(4.0 == +4.0);
	assert(0-4.0 == -4.0);
	assert(1.0 + 1.0 == 2.0);
	assert(2.0 * 3.0 == 6.0);
	assert(6.0 / 3.0 == 2.0);
	assert(4.0 < 5.0);
	assert(4.0 > 3.0);
	assert(4.0 <= 5.0);
	assert(4.0 <= 4.0);
	assert(4.0 >= 3.0);
	assert(4.0 == 4.0);
	assert(4.0 != 3.0);
}

# Test operations on strings.
{
	assert('hey' == 'hey');
	assert('hey' != 'hey2');
}

# Test operations on bools.
{
	assert(true);
	assert(true == true);
	assert(true != false);
	assert(false == false);
	assert(false != true);
	assert(true == not false);
	assert(false == not true);
	assert((true  and true ) == true);
	assert((true  and false) == false);
	assert((false and true ) == false);
	assert((false and false) == false);
	assert((true  or true ) == true);
	assert((true  or false) == true);
	assert((false or true ) == true);
	assert((false or false) == false);
}

# Test short-circuitness of the logical operators
{
	# The assertions shouldn't trigger. 
	true or assert(false);
	false and assert(false);
}

# Test lists.
{
	[1]; [1.0]; ['x']; [1, 1]; [1.0, 1.0]; ['x', 'x'];
}

# Test maps.
{
	({}); 
	({ ''   : none  });
	({ 1    : none  });
	({ 1.0  : none  });
	({ none : none  });
	({ true : none  });
	({ false: none  });
	({ []   : none  });
	({ {}   : none  });
	({ none : ''    });
	({ none : 1     });
	({ none : 1.0   });
	({ none : true  });
	({ none : false });
	({ none : []    });
	({ none : {}    });
}

# Test if-else statements.
{
	if true: r = true; else r = false;
	assert(r);

	if true: { r = true; } else { r = false; }
	assert(r);

	if false: r = false; else r = true;
	assert(r);

	if false: { r = false; } else { r = true; }
	assert(r);
}

# Test type variables
{
	assert(type(none) == None);
	assert(type(1)    == int);
	assert(type(10.4) == float);
	assert(type("Hello, world!") == String);
	assert(type([])   == List);
	assert(type({})   == Map);
}

print('No assertion failed.\n');