package org.col.parser;

import com.google.common.collect.Lists;
import org.junit.Test;

import java.util.List;

/**
 *
 */
public class BooleanParserTest extends ParserTestBase<Boolean> {

  public BooleanParserTest() {
    super(BooleanParser.PARSER);
  }

  @Test
  public void parse() throws Exception {
    assertParse(true, "true");
    assertParse(true, "-1-");
    assertParse(true, "yes!");
    assertParse(true, " t    ");
    assertParse(true, "T");
    assertParse(true, "si");
    assertParse(true, "ja");
    assertParse(true, "oui");
    assertParse(true, "wahr");

    assertParse(false,"f");
    assertParse(false,"f");
    assertParse(false,"no");
    assertParse(false,"nein");
  }

  @Override
  List<String> additionalUnparsableValues() {
    return Lists.newArrayList("t ru e", "a", "2");
  }

}
@@ -336,38 +336,8 @@
 %22);%0A
-    assertParse(true, %22-1-%22);%0A
     
@@ -362,9 +362,8 @@
 %22yes
-!
 %22);%0A
@@ -655,24 +655,54 @@
 se,%22nein%22);%0A
+    assertParse(false, %22-1%22);%0A
   %7D%0A%0A  @Over

Fix boolean parser, expecting -1 to become false