2024-02-22 15:11:26 +00:00
|
|
|
package net.sourceforge.plantuml.tim.stdlib;
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
2024-02-24 11:03:21 +00:00
|
|
|
import java.util.Collections;
|
2024-02-22 19:06:59 +00:00
|
|
|
import java.util.List;
|
2024-02-22 15:11:26 +00:00
|
|
|
|
|
|
|
import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores;
|
|
|
|
import org.junit.jupiter.api.IndicativeSentencesGeneration;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
2024-02-22 19:28:03 +00:00
|
|
|
import net.sourceforge.plantuml.tim.EaterException;
|
2024-02-22 15:11:26 +00:00
|
|
|
import net.sourceforge.plantuml.tim.TFunction;
|
|
|
|
import net.sourceforge.plantuml.tim.expression.TValue;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests the builtin function.
|
|
|
|
*/
|
|
|
|
@IndicativeSentencesGeneration(separator = ": ", generator = ReplaceUnderscores.class)
|
|
|
|
|
|
|
|
class GetAllStdlibTest {
|
|
|
|
TFunction cut = new GetAllStdlib();
|
|
|
|
final String cutName = "GetAllStdlib";
|
|
|
|
|
|
|
|
@Test
|
2024-02-22 19:28:03 +00:00
|
|
|
void Test_without_Param() throws EaterException {
|
2024-02-24 11:03:21 +00:00
|
|
|
final List<TValue> empty = Collections.emptyList();
|
2024-02-22 19:06:59 +00:00
|
|
|
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
|
2024-02-22 15:11:26 +00:00
|
|
|
assertThat(tValue.toString()).contains("archimate", "aws", "tupadr3");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2024-02-22 19:28:03 +00:00
|
|
|
void Test_with_one_argument() throws EaterException {
|
2024-02-22 15:11:26 +00:00
|
|
|
final TValue tValue = cut.executeReturnFunction(null, null, null, Arrays.asList(TValue.fromInt(0)), null);
|
|
|
|
assertThat(tValue.toString()).contains("archimate", "https://github.com/plantuml-stdlib/Archimate-PlantUML");
|
|
|
|
}
|
|
|
|
}
|