5180 fichiers 38.5 Mo 0 téléchargements 206 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / wired / WiredVariableTargets.test.ts
WiredVariableTargets.test.ts 795 o Télécharger le fichier
import { describe, expect, it } from 'vitest';
import { fromOfficialComparison, fromOfficialVariableTarget, toOfficialComparison, toOfficialVariableTarget } from './WiredVariableTargets';

describe('WiredVariableTargets', () =>
{
    it('maps our kinds to the official targets and back', () =>
    {
        expect([ 0, 1, 2, 3 ].map(toOfficialVariableTarget)).toEqual([ 1, 0, -20, -10 ]);
        expect([ 1, 0, -20, -10 ].map(fromOfficialVariableTarget)).toEqual([ 0, 1, 2, 3 ]);
    });

    it('maps the comparisons both ways', () =>
    {
        for(let ours = 0; ours < 6; ours++) expect(fromOfficialComparison(toOfficialComparison(ours))).toBe(ours);
        expect(toOfficialComparison(2)).toBe(1); // equals
        expect(toOfficialComparison(0)).toBe(2); // greater than
    });
});
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser