Split size and unit bitstring core_language tests up and make sure they run properly
@@ -32,11 +32,18 @@ pub fn size_variable_from_match_test() {
should.equal(species, <<"Walrus":utf8>>)
}
-pub fn sizes_with_expressions() {
+pub fn sizes_with_expressions_test() {
let a = 1
- let b = <<a:unit(2)-size(a * 2), a:size(3 + integer_fn())-unit(1)>>
+ let b = <<a:size(a * 2), a:size(3 + integer_fn())>>
- should.equal(b, <<1, 1>>)
+ should.equal(b, <<1:2, 1:4>>)
+}
+
+// Units
+pub fn units_test() {
+ let a = <<1:size(1)-unit(8), 2:size(1)-unit(16)>>
+
+ should.equal(a, <<1, 0, 2>>)
}
// Strings
