Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests work on Windows and typos #257

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Usage: IrpTransmogrifier [options] [command] [command options]
Issue only the version number of the program proper.
Default: false

list List protocols and their properites.
list List protocols and their properties.
Usage: list [options] List of protocols (default all)
Options:
-a, --all
Expand Down
2 changes: 1 addition & 1 deletion common/xslt/mkProps.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public final class Props {
boolean status = baseFile.mkdirs();
if (!status) {
System.err.println("Could not create directory " + baseFile.getAbsolutePath()
+ ", saving properites in home direcory");
+ ", saving properties in home directory");
baseFile = new File(System.getProperty("user.home")); // emergency
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/harctoolbox/cmdline/CommandList.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

@SuppressWarnings("FieldMayBeFinal")

@Parameters(commandNames = {"list"}, commandDescription = "List protocols and their properites.")
@Parameters(commandNames = {"list"}, commandDescription = "List protocols and their properties.")
public class CommandList extends AbstractCommand {

private static final Logger logger = Logger.getLogger(CommandList.class.getName());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/harctoolbox/ircore/IrCoreUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public final class IrCoreUtils {
public final static long SOME = -3L;

public static final String LINE_SEPARATOR = System.getProperty("line.separator");
public static final String NEWLINE_REGEX = "\\r?\\n";

private static Map<Integer, String> radixPrefixes;
private static Map<String, Integer> prefixToRadix;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/harctoolbox/irp/Evaluatable.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ interface Evaluatable {

public Integer numberOfBitSpecs();

public Map<String, Object> propertiesMap(int noProperites);
public Map<String, Object> propertiesMap(int noProperties);
}
4 changes: 2 additions & 2 deletions src/main/java/org/harctoolbox/irp/Expression.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public Number toNumber() {
}

@Override
public Map<String, Object> propertiesMap(int noProperites) {
return IrpUtils.propertiesMap(noProperites, "Expression");
public Map<String, Object> propertiesMap(int noProperties) {
return IrpUtils.propertiesMap(noProperties, "Expression");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/harctoolbox/irp/IrStreamItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static IrStreamItem newIrStreamItem(IrpParser.Irstream_itemContext ctx) {

public Map<String, Object> propertiesMap(GeneralSpec generalSpec, NameEngine nameEngine);

public Map<String, Object> propertiesMap(int noProperites);
public Map<String, Object> propertiesMap(int noProperties);

public Double microSeconds(GeneralSpec generalSpec, NameEngine nameEngine);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/harctoolbox/irp/IrpObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public Integer numberOfBitSpecs() {
public void prerender(RenderData renderData, IrSignal.Pass pass, List<BitSpec> bitSpecs) {
}

public Map<String, Object> propertiesMap(int noProperites) {
return IrpUtils.propertiesMap(noProperites, this);
public Map<String, Object> propertiesMap(int noProperties) {
return IrpUtils.propertiesMap(noProperties, this);
}

@SuppressWarnings("NoopMethodInAbstractClass")
Expand Down
2 changes: 1 addition & 1 deletion src/main/xdocs/IrpTransmogrifier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ Commands:
expression Evaluate expression given as argument.
help Describe the syntax of program and commands.
lirc Convert Lirc configuration files to IRP form.
list List protocols and their properites
list List protocols and their properties
render Render signal from parameters
version Report version

Expand Down
26 changes: 13 additions & 13 deletions src/test/java/org/harctoolbox/irp/IrpTransmogrifierNGTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,23 @@ public void testDecodeNoRepeatedNec() {
System.out.println("decodeNoRepeatedNec");
String args = "decode --debug nec1 +9041 -4507 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -44293";
String result = execute(args);
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0].substring(0,21), "NEC: {D=12,S=34,F=56}");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0].substring(0,21), "NEC: {D=12,S=34,F=56}");
}

@Test(enabled = true)
public void testDecodeRepeatedNec1() {
System.out.println("decodeRepeatedNec1");
String args = "decode -p nec1 -r +9041 -4507 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -44293 +9041 -2267 +626 -96193 +9041 -2267 +626 -96193 +9041 -2267 +626 -96193 +9041 -2267 +626 -96193";
String result = execute(args);
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "NEC1: {D=12,S=34,F=56}");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "NEC1: {D=12,S=34,F=56}");
}

@Test(enabled = true)
public void testDecodeNec1OneDitto() {
System.out.println("testDecodeNec1OneDitto");
String args = "decode -p nec1 +9041 -4507 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -1694 +573 -573 +573 -573 +573 -573 +573 -1694 +573 -1694 +573 -44293 +9041 -2267 +626 -96193";
String result = execute(args);
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1");
}

@Test(enabled = true)
Expand All @@ -282,10 +282,10 @@ public void testDecodeNec1OneDittoNec1TwoDittoJunk() {
String sequence = NEC1INTRO + " " + NEC1DITTO + " " + NEC1INTRO + " " + NEC1DITTO + " " + NEC1DITTO + "+1234 -54678";
String args = "decode -p nec1 " + sequence;
String result = execute(args);
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1 {UNDECODED. length=78}");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1 {UNDECODED. length=78}");
args = "decode -p nec1 --recursive " + sequence;
result = execute(args);
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1 {NEC1: {D=12,S=34,F=56}, beg=72, end=147, reps=2 {UNDECODED. length=2}}");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "NEC1: {D=12,S=34,F=56}, beg=0, end=71, reps=1 {NEC1: {D=12,S=34,F=56}, beg=72, end=147, reps=2 {UNDECODED. length=2}}");
}

@Test(enabled = true)
Expand Down Expand Up @@ -624,56 +624,56 @@ public void testSillyCommand() {
public void testHelp() {
System.out.println("testHelp");
String result = execute("help");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
}

@Test(enabled = true)
public void testDashHelp() {
System.out.println("testDashHelp");
String result = execute("--help");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
}

@Test(enabled = true)
public void testHelpShort() {
System.out.println("testHelpShort");
String result = execute("help --short");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "Usage: IrpTransmogrifier [options] [command] [command options]");
}

@Test(enabled = true)
public void testHelpCommon() {
System.out.println("testHelpCommon");
String result = execute("help --common");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "Common options:");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "Common options:");
}

@Test(enabled = true)
public void testHelpDashHelp() {
System.out.println("testHelpDashHelp");
String result = execute("help --help");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "Describe the syntax of program and commands.");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "Describe the syntax of program and commands.");
}

@Test(enabled = true)
public void testHelpDescribe() {
System.out.println("testHelpDescribe");
String result = execute("help --describe");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "This command list the syntax for the command(s) given as argument,");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "This command list the syntax for the command(s) given as argument,");
}

@Test(enabled = true)
public void testHelpList() {
System.out.println("testHelpList");
String result = execute("help list");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "List protocols and their properites.");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "List protocols and their properties.");
}

@Test(enabled = true)
public void testListHelp() {
System.out.println("testListHelp");
String result = execute("list --help");
assertEquals(result.split(IrCoreUtils.LINE_SEPARATOR)[0], "List protocols and their properites.");
assertEquals(result.split(IrCoreUtils.NEWLINE_REGEX)[0], "List protocols and their properties.");
}

@Test(enabled = true)
Expand Down