Skip to content

Commit

Permalink
Lots of changes to maintain code coverage. Thanks chatGPT.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnemesh committed Jan 15, 2025
1 parent de9a1b9 commit 7d1ff5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,6 @@ protected String[] customCommandLineValidation() {
if (TAG_VALUES_OUTPUT != null)
IOUtil.assertFileIsWritable(this.TAG_VALUES_OUTPUT);

if (useBaseCompression & useFixedLengthBaseCompression) {
list.add("Overriding the useBaseCompression flag with useFixedLengthBaseCompression flag.");
this.useBaseCompression=false;
}



return CustomCommandLineValidationHelper.makeValue(super.customCommandLineValidation(), list);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.assertNull;

public class CompareBAMTagValuesTest {

Expand Down Expand Up @@ -196,4 +197,27 @@ public void testPairedReadOrderComparator_BothUnpaired() {
assertEquals(result, 0, "Both unpaired reads should be considered equal");
}

@Test
public void testCustomCommandLineValidation() {
CompareBAMTagValues compareBAMTagValues = new CompareBAMTagValues();

// Case 1: TAGS_1 and TAGS_2 length mismatch
compareBAMTagValues.TAGS_1 = Arrays.asList("CB", "CR");
compareBAMTagValues.TAGS_2 = Collections.singletonList("CB");
String[] validationResult = compareBAMTagValues.customCommandLineValidation();
assertEquals(validationResult.length, 1);
assertEquals(validationResult[0], "TAGS_1 and TAGS_2 must be the same length.");

// Case 2: Writable files
compareBAMTagValues.TAGS_1 = Arrays.asList("CB", "CR");
compareBAMTagValues.TAGS_2 = Arrays.asList("CB", "CR");
compareBAMTagValues.BAM_OUTPUT_1 = new File("test_output_1.bam");
compareBAMTagValues.BAM_OUTPUT_2 = new File("test_output_2.bam");
compareBAMTagValues.READ_COUNT_OUTPUT = new File("read_count_output.txt");
compareBAMTagValues.TAG_VALUES_OUTPUT = new File("tag_values_output.txt");
validationResult = compareBAMTagValues.customCommandLineValidation();
assertNull(validationResult);

}

}

0 comments on commit 7d1ff5f

Please sign in to comment.