Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_Dedupe.js   Sprache: JAVA

 
/* Any copyright is dedicated to the Public Domain.
 * https://creativecommons.org/publicdomain/zero/1.0/
 */


"use strict";

const { Dedupe } = ChromeUtils.importESModule(
  "resource:///modules/Dedupe.sys.mjs"
);

add_task(async function test_dedupe_group() {
  let instance = new Dedupe();

  // Should remove duplicates inside the groups
  let beforeItems = [
    [1, 1, 1],
    [2, 2, 2],
    [3, 3, 3],
  ];
  let afterItems = [[1], [2], [3]];
  Assert.deepEqual(
    instance.group(...beforeItems),
    afterItems,
    "Should remove duplicates inside the groups"
  );

  // Should remove duplicates between groups, favoring earlier groups
  beforeItems = [
    [1, 2, 3],
    [2, 3, 4],
    [3, 4, 5],
  ];
  afterItems = [[1, 2, 3], [4], [5]];
  Assert.deepEqual(
    instance.group(...beforeItems),
    afterItems,
    "Should remove duplicates between groups"
  );

  // Should remove duplicates from groups of objects
  instance = new Dedupe(item => item.id);
  beforeItems = [
    [{ id: 1 }, { id: 1 }, { id: 2 }],
    [{ id: 1 }, { id: 3 }, { id: 2 }],
    [{ id: 1 }, { id: 2 }, { id: 5 }],
  ];
  afterItems = [[{ id: 1 }, { id: 2 }], [{ id: 3 }], [{ id: 5 }]];
  Assert.deepEqual(
    instance.group(...beforeItems),
    afterItems,
    "Should remove duplicates from groups of objects"
  );
});

Messung V0.5
C=91 H=93 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge