You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
282 B

4 years ago
  1. 'use strict';
  2. var Buffer = require('../../').Buffer;
  3. var assert = require('assert');
  4. assert.doesNotThrow(function() {
  5. Buffer.allocUnsafe(10);
  6. });
  7. assert.throws(function() {
  8. Buffer.from(10, 'hex');
  9. });
  10. assert.doesNotThrow(function() {
  11. Buffer.from('deadbeaf', 'hex');
  12. });