-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmallestLetterGreaterThanTargetTest.java
More file actions
executable file
·31 lines (26 loc) · 1.28 KB
/
Copy pathSmallestLetterGreaterThanTargetTest.java
File metadata and controls
executable file
·31 lines (26 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.junit.jupiter:junit-jupiter-engine:5.10.1
//DEPS org.junit.platform:junit-platform-console:1.9.3
//SOURCES SmallestLetterGreaterThanTarget.java
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.platform.console.tasks.ConsoleTestExecutor;
import org.junit.platform.engine.discovery.DiscoverySelectors;
import org.junit.platform.console.options.CommandLineOptions;
import java.io.PrintWriter;
import java.util.List;
public class SmallestLetterGreaterThanTargetTest {
@Test
public void testExecuter() {
var executer = new SmallestLetterGreaterThanTarget();
assertEquals('a', executer.execute(new char[]{'a','b'}, 'z'));
assertEquals('c', executer.execute(new char[]{'c','f','j'}, 'a'));
assertEquals('f', executer.execute(new char[]{'c','f','j'}, 'c'));
assertEquals('f', executer.execute(new char[]{'c','f','j'}, 'd'));
}
public static void main(String... args) throws Exception {
CommandLineOptions options = new CommandLineOptions();
options.setSelectedClasses(List.of(DiscoverySelectors.selectClass(SmallestLetterGreaterThanTargetTest.class)));
new ConsoleTestExecutor(options).execute(new PrintWriter(System.out));
}
}