
const Buffer = s2.Buffer.new;

scope {

  var b = Buffer();
  assert b inherits s2.Buffer;
  assert !b.capacity();
  assert !b.length();
  b.length(10);
  assert 10 === b.length();
  assert b.capacity() >= b.length();
}


scope {
  var sz = 20;
  var b = Buffer(sz);
  assert !b.length();
  assert b.capacity() >= sz;
  b.append('a');
  assert 1 === b.length();
  b.appendf('%1$d', 1);
  assert 2 === b.length();
}

/* TODO: port in the th1ish Buffer unit tests. */
