package com.formulasearchengine.mathosphere.mlp.cli;

import org.junit.Test;

import static org.junit.Assert.*;

public class CliParamsTest {

  @Test
  public void help() {
    String[] args = {"help"};
    CliParams params = CliParams.from(args);
    assertEquals("help", params.getCommand());
  }

  @Test
  public void useTex() {
    String[] args = {"mlp", "--tex"};
    CliParams params = CliParams.from(args);
    assertEquals("mlp", params.getCommand());
    assertTrue(params.getMlpCommandConfig().getUseTeXIdentifiers());
  }

  @Test
  public void notUseTex() {
    String[] args = {"mlp"};
    CliParams params = CliParams.from(args);
    assertEquals("mlp", params.getCommand());
    assertFalse(params.getMlpCommandConfig().getUseTeXIdentifiers());
  }

  @Test
  public void count() {
    String[] args = {"count", "--formulae", "-in", "c:/tmp/mlp/input/"};
    CliParams params = CliParams.from(args);
    assertEquals("count", params.getCommand());

    CountCommandConfig count = params.getCount();

    assertTrue(count.isFormulas());
    assertFalse(count.isDefinitions());
    assertFalse(count.isIdentifiers());
    assertEquals("c:/tmp/mlp/input/", count.getInput());
  }

}

@@ -106,9 +106,107 @@
 ert.
-*
+assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue
 ;%0A%0Ap
@@ -332,32 +332,32 @@
 ams.from(args);%0A
-
     assertEquals
@@ -384,32 +384,255 @@
 ommand());%0A  %7D%0A%0A
+%0A  @Test%0A  public void texvcinfo() %7B%0A    String%5B%5D args = %7B%22tags%22, %22--texvcinfo%22, %22expected%22%7D;%0A    CliParams params = CliParams.from(args);%0A    assertEquals(%22expected%22, params.getTagsCommandConfig().getTexvcinfoUrl());%0A  %7D%0A%0A
   @Test%0A  public

Test setting texvcinfo url from cli