h00n24 / ifj_tester Goto Github PK
View Code? Open in Web Editor NEWTester na IFJ projekt
Tester na IFJ projekt
U testování chybových kódů vracených funkcí substr testy očekávají indexování znaků řetězce od jedničky. Dle zadání je to od nuly. Konkrétně jsou to testy: exec_test3 a exec_test5
@NoName115
V syna_test_2 ma byt sematicka chyba 4.
@H00N24 @kubaj @NoName115 @halficek
poprosím dorobiť testy pre rozšírenie CYCLES
napr...
class Main
{
static void run()
{
for(int i = 0; i < 5; i = i + 1)
{
ifj16.print(i + "\n");
for(int j = 10; j > 5; j = j - 1)
{
ifj16.print(j + "\n");
}
}
}
}
Môžem poprosiť o upresnenie prečo syna_test_3.code končí chybou?
class Main
{
static int ahoj()
{
int a = 5;
return a;
}
static void run()
{
int a = 5 + ahoj(); //syntax error
}
}
Testy v podstate rovnaké. V oboch sa vracia hodnota vo void funkciach. Prečo jeden vracia chybu 8 a druhý 4?
exec_test_2.code:
class Main
{
static void run()
{
double v = voidFunction(2.589);
}
static void voidFunction(double d)
{
return 12.58;
}
}
vracia 8
exec_test_44.code
class Main
{
static void run()
{
test();
}
static void test()
{
return 5;
}
}
vracia 4
//Test SIMPLE
class Main
{
static int iter = 5;
static void run()
{
while(iter > 0)
iterator.processValue();
iterator.printStatus(iter);
iter = 6;
while(iter > 1)
iterator.processValue();
iterator.printStatus(iter);
iter = 6;
while(iter > 2)
iterator.processValue();
iterator.printStatus(iter);
iter = 10;
while(iter > 4)
{
iterator.processValue();
iterator.processValue();
}
iterator.printStatus(iter);
}
}
class iterator
{
static void processValue()
{
ifj16.print(Main.iter + "\n");
Main.iter = Main.iter - 1;
}
static void printStatus(int iter)
{
if(iter == 0)
ifj16.print("Success!\n");
else if(iter == 1)
ifj16.print("Fail 1\n");
else if(iter == 2)
ifj16.print("Fail 2\n");
else if(iter > 2)
{
ifj16.print("Fail > 2\n");
return;
}
}
}
//Lexikalny test 4 lex_test/lex_test_4 1
class Main
{
static int a = 1232132132132132134213213213213214335435324213213213214253242143215325342143242141432412321451243254342132152321421321352321214532;
}
Test lex_test_4.code by mal skončiť s kódom 1, čiže lexikálna chyba. Podľa mňa toto lexikálna chyba nie je alebo sa mýlim?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.