Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/testing/web-platform/tests/FileAPI/support/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  Blob.js   Sprache: JAVA

 
'use strict'

self.test_blob = (fn, expectations) => {
  var expected = expectations.expected,
      type = expectations.type,
      desc = expectations.desc;

  promise_test(async (t) => {
    var blob = fn();
    assert_true(blob instanceof Blob);
    assert_false(blob instanceof File);
    assert_equals(blob.type, type);
    assert_equals(blob.size, expected.length);

    const text = await blob.text();
    assert_equals(text, expected);
  }, desc);
}

self.test_blob_binary = (fn, expectations) => {
  var expected = expectations.expected,
      type = expectations.type,
      desc = expectations.desc;

  promise_test(async (t) => {
    var blob = fn();
    assert_true(blob instanceof Blob);
    assert_false(blob instanceof File);
    assert_equals(blob.type, type);
    assert_equals(blob.size, expected.length);

    const ab = await blob.arrayBuffer();
    assert_true(ab instanceof ArrayBuffer,
      "Result should be an ArrayBuffer");
    assert_array_equals(new Uint8Array(ab), expected);
  }, desc);
}

// Assert that two TypedArray objects have the same byte values
self.assert_equals_typed_array = (array1, array2) => {
  const [view1, view2] = [array1, array2].map((array) => {
    assert_true(array.buffer instanceof ArrayBuffer,
      'Expect input ArrayBuffers to contain field `buffer`');
    return new DataView(array.buffer, array.byteOffset, array.byteLength);
  });

  assert_equals(view1.byteLength, view2.byteLength,
    'Expect both arrays to be of the same byte length');

  const byteLength = view1.byteLength;

  for (let i = 0; i < byteLength; ++i) {
    assert_equals(view1.getUint8(i), view2.getUint8(i),
      `Expect byte at buffer position ${i} to be equal`);
  }
}

Messung V0.5
C=95 H=98 G=96

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.