Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test
on:
pull_request:

jobs:
testLinux:
name: Test Linux
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- run: |
make && make test
testOSX:
name: Test OSX
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v2
- run: |
make && make test
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion 2bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void bytes2bases(char *seq, uint8_t *byte, uint32_t sz, int offset) {

// Deal with the first partial byte
if(offset != 0) {
while(offset < 4) {
while(offset < 4 && pos < sz) {
seq[pos++] = byte2base(foo, offset++);
}
if(pos >= sz) return;
Expand Down
12 changes: 12 additions & 0 deletions test/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
0 chr1 150 offset 0x4a
1 chr2 100 offset 0x88
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACGTACGTACGTagctagctGATCGATCGTAGCTAGCTAGCTAGCTGATCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNACGTACGTACGTagctagctGATC
0 0.080000
1 0.080000
2 0.086667
3 0.086667
0 0.120000
1 0.120000
2 0.120000
3 0.120000
11 changes: 4 additions & 7 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
# N.B., this MUST be run from within the source directory!

# Read test
p1 = Popen(["./test/exampleRead", "test/foo.2bit"], stdout=PIPE)
try:
p2 = Popen(["md5sum"], stdin=p1.stdout, stdout=PIPE)
except:
p2 = Popen(["md5"], stdin=p1.stdout, stdout=PIPE)
md5sum = p2.communicate()[0].strip().split()[0]
assert(md5sum == "0274c32c7f3dd75e8991f6107dca6a5f")
o = open("test/found", "w")
check_call(["./test/exampleRead", "test/foo.2bit"], stdout=o)
o.close()
check_call(["diff", "test/found", "test/expected"])

print("Passed!")
Loading