blob: 91885e99ce035e0f39539959b3fe16b867f8f7a3 (
plain)
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
32
33
34
35
|
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class PlacingParenTest {
@Test
void test() {
String exp = "1+5";
assertEquals(6, PlacingParen.getMaxValue(exp));
;
}
@Test
void test1() {
String exp = "5-8+7*4-8+9";
assertEquals(200, PlacingParen.getMaxValue(exp));
;
}
@Test
void test2() {
String exp = "1+2-3*4-5";
assertEquals(6, PlacingParen.getMaxValue(exp));
;
}
@Test
void test3() {
String exp = "1+2*3";
assertEquals(9, PlacingParen.getMaxValue(exp));
;
}
}
|