Browse Source

fixed unittests by adding opEquals to PerBaseInfo.Result

remotes/georgeg/no_streams
lomereiter 10 years ago
parent
commit
852c1b62e6
  1. 10
      bio/bam/baseinfo.d
  2. 4
      test/unittests.d

10
bio/bam/baseinfo.d

@ -99,6 +99,16 @@ struct PerBaseInfo(R, Tags...) {
return to!string(base);
}
bool opEquals(T)(T base) if (is(Unqual!T == Base))
{
return this.base == base;
}
bool opEquals(T)(T result) if (is(Unqual!T == Result))
{
return this == result;
}
mixin(getResultProperties!Extensions());
}

4
test/unittests.d

@ -388,11 +388,11 @@ unittest {
bases = basesWith!("FZ", "MD")(r, arg!"flowOrder"(flow_order),
arg!"keySequence"(key_sequence));
// if reverse strand, bases are also reverse complemented
assert(equal(bases.save, map!"a.complement"(retro(r.sequence))));
assert(equal(bases, map!"a.complement"(retro(r.sequence))));
} else {
bases = basesWith!("FZ", "MD")(r, arg!"flowOrder"(flow_order),
arg!"keySequence"(key_sequence));
assert(equal(bases.save, r.sequence));
assert(equal(bases, r.sequence));
}
}
}

Loading…
Cancel
Save