Unit tests for assist, update tester
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ed7c052520
commit
bb6a4a3e6d
|
@ -11,6 +11,7 @@ namespace Gen7 {
|
||||||
for (int i = 0; i < party.Length; i++){
|
for (int i = 0; i < party.Length; i++){
|
||||||
auto mon = party.GetAtIndex(i);
|
auto mon = party.GetAtIndex(i);
|
||||||
if (mon is null){ continue; }
|
if (mon is null){ continue; }
|
||||||
|
if (mon is user){ continue; }
|
||||||
auto moves = mon.GetMoves();
|
auto moves = mon.GetMoves();
|
||||||
for (uint j = 0; j < moves.length; j++){
|
for (uint j = 0; j < moves.length; j++){
|
||||||
auto m = moves[j];
|
auto m = moves[j];
|
||||||
|
@ -37,7 +38,39 @@ void Assist_ChangesMove(){
|
||||||
auto p2 = CreateSimpleParty({"venusaur", "pikachu"}, 100);
|
auto p2 = CreateSimpleParty({"venusaur", "pikachu"}, 100);
|
||||||
|
|
||||||
auto battle = CreateSimpleBattle(684, p1, p2);
|
auto battle = CreateSimpleBattle(684, p1, p2);
|
||||||
|
p1.GetAtIndex(1).LearnMove("bubble_beam");
|
||||||
|
auto choice = CreateMoveTurnChoice("assist", p1.GetAtIndex(0), 1, 0);
|
||||||
|
constString moveName = "assist";
|
||||||
|
auto script = cast<Gen7::Assist>(CreateMoveScript("Assist"));
|
||||||
|
script.ChangeAttack(choice, moveName);
|
||||||
|
RequireEquals("bubble_beam", moveName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test name="Assist: Doesn't switch when move can't be copied"]
|
||||||
|
void Assist_CantSwitchIntoNonCopyable(){
|
||||||
|
auto p1 = CreateSimpleParty({"charizard", "blastoise"}, 100);
|
||||||
|
auto p2 = CreateSimpleParty({"venusaur", "pikachu"}, 100);
|
||||||
|
|
||||||
|
auto battle = CreateSimpleBattle(684, p1, p2);
|
||||||
|
p1.GetAtIndex(1).LearnMove("dig");
|
||||||
|
auto choice = CreateMoveTurnChoice("assist", p1.GetAtIndex(0), 1, 0);
|
||||||
|
constString moveName = "assist";
|
||||||
|
auto script = cast<Gen7::Assist>(CreateMoveScript("Assist"));
|
||||||
|
script.ChangeAttack(choice, moveName);
|
||||||
|
RequireEquals("assist", moveName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test name="Assist: Doesn't switch if no move"]
|
||||||
|
void Assist_CantSwitchWhenNoOptions(){
|
||||||
|
auto p1 = CreateSimpleParty({"charizard", "blastoise"}, 100);
|
||||||
|
auto p2 = CreateSimpleParty({"venusaur", "pikachu"}, 100);
|
||||||
|
|
||||||
|
auto battle = CreateSimpleBattle(684, p1, p2);
|
||||||
|
auto choice = CreateMoveTurnChoice("assist", p1.GetAtIndex(0), 1, 0);
|
||||||
|
constString moveName = "assist";
|
||||||
|
auto script = cast<Gen7::Assist>(CreateMoveScript("Assist"));
|
||||||
|
script.ChangeAttack(choice, moveName);
|
||||||
|
RequireEquals("assist", moveName);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
TESTERVERSION=0.0.2
|
TESTERVERSION=0.0.2.1
|
||||||
|
|
||||||
# Get the release information from the api for the specified version
|
# Get the release information from the api for the specified version
|
||||||
curl -X GET "https://git.p-epsilon.com/api/v1/repos/Deukhoofd/PokemonScriptTester/releases/tags/$TESTERVERSION" -H "accept: application/json" |
|
curl -X GET "https://git.p-epsilon.com/api/v1/repos/Deukhoofd/PokemonScriptTester/releases/tags/$TESTERVERSION" -H "accept: application/json" |
|
||||||
|
|
Loading…
Reference in New Issue