From 49e4bf64b7ba0d7c412919ac1573b07c7263a6b0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 23 Jan 2023 14:06:40 +0100 Subject: [PATCH] Add ArrayLength test --- testsrc/de/steamwar/command/ArgumentCommand.java | 4 ++++ testsrc/de/steamwar/command/ArgumentCommandTest.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/testsrc/de/steamwar/command/ArgumentCommand.java b/testsrc/de/steamwar/command/ArgumentCommand.java index 451d6e9..41f59c7 100644 --- a/testsrc/de/steamwar/command/ArgumentCommand.java +++ b/testsrc/de/steamwar/command/ArgumentCommand.java @@ -67,4 +67,8 @@ public class ArgumentCommand extends TestSWCommand { public void minAndMaxLengthArgument(String sender, @Length(min = 3, max = 3) @StaticValue({"wo", "world"}) String arg) { throw new ExecutionIdentifier("RunLengthArgument with String"); } + + public void arrayLengthArgument(String sender, @ArrayLength(max = 3) @StaticValue({"one", "two", "three"}) String... args) { + throw new ExecutionIdentifier("RunArrayLengthArgument with String"); + } } diff --git a/testsrc/de/steamwar/command/ArgumentCommandTest.java b/testsrc/de/steamwar/command/ArgumentCommandTest.java index 5450c6e..b46c184 100644 --- a/testsrc/de/steamwar/command/ArgumentCommandTest.java +++ b/testsrc/de/steamwar/command/ArgumentCommandTest.java @@ -121,5 +121,8 @@ public class ArgumentCommandTest { strings = cmd.tabComplete("test", "", new String[]{"worl"}); assertTabCompletes(strings, "wor", "worl"); + + strings = cmd.tabComplete("test", "", new String[]{"one", "two", "three", "one"}); + assertTabCompletes(strings); } }