upd: add exit on error in examples

This commit is contained in:
samsonium
2026-10-18 18:40:48 +03:00
parent dce64e8b4d
commit f0e641928d
6 changed files with 55 additions and 14 deletions
+14 -2
View File
@@ -21,14 +21,26 @@ a.name = "Buryatka";
a.age = 5;
Animal b = a.copy();
a.name = "Gavryusha";
a.age = 10;
b.name = "Gavryusha";
b.age = 10;
printline(a);
printline(b);
printline("Types are same:");
printline(a.type == b.type);
printline("Names are NOT the same");
printline(a.name != b.name);
printline("1st age less than 2nd");
printline(a.age < b.age);
if (a.type == b.type && a.name != b.name && a.age < b.age)
printline("Test passed");
else
{
printline("Test failed");
exit(1);
}