mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
80 lines
695 B
Plaintext
80 lines
695 B
Plaintext
//booleans
|
|
{
|
|
var value = true;
|
|
|
|
if (value) {
|
|
print "correct";
|
|
}
|
|
else {
|
|
assert false;
|
|
}
|
|
}
|
|
|
|
{
|
|
var value = false;
|
|
|
|
if (value) {
|
|
assert false;
|
|
}
|
|
else {
|
|
print "correct";
|
|
}
|
|
}
|
|
|
|
//integers
|
|
{
|
|
var value: int = 42;
|
|
|
|
if (value) {
|
|
print "correct";
|
|
}
|
|
else {
|
|
assert false;
|
|
}
|
|
}
|
|
|
|
{
|
|
var value: int = 0;
|
|
|
|
if (value) {
|
|
assert false;
|
|
}
|
|
else {
|
|
print "correct";
|
|
}
|
|
}
|
|
|
|
//floats
|
|
{
|
|
var value: float = 42.8891;
|
|
|
|
if (value) {
|
|
print "correct";
|
|
}
|
|
else {
|
|
assert false;
|
|
}
|
|
}
|
|
|
|
{
|
|
var value: float = 0;
|
|
|
|
if (value) {
|
|
assert false;
|
|
}
|
|
else {
|
|
print "correct";
|
|
}
|
|
}
|
|
|
|
//everything else
|
|
{
|
|
var value: string = "foobar";
|
|
|
|
if (value) {
|
|
print "correct";
|
|
}
|
|
else {
|
|
assert false;
|
|
}
|
|
} |