summaryrefslogtreecommitdiffstats
path: root/src/test/java/test/QuotedMainTest.java
blob: 68126eac99d7a0e5eba78cb91d7a09c00d490398 (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
package test;

import java.util.ArrayList;
import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;

public class QuotedMainTest {
  @Parameter
  List<String> args = new ArrayList<>();
  
  String quoted = "\" \"";

  @Test
  public void testMain() {
    JCommander jc = new JCommander(this);
    jc.parse(quoted);
    Assert.assertEquals(args.size(), 1);
    Assert.assertEquals(args.get(0), " ");
  }
  
  public static void main(String[] args) {
    new QuotedMainTest().testMain();
  }
}