Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

index.test.js 946B

1234567891011121314151617181920212223242526272829
  1. const {showInvisibles, generateDifferences} = require('..');
  2. const assert = require('assert');
  3. describe('showInvisibles', () => {
  4. it('shows invisibles', () => {
  5. assert.strictEqual(showInvisibles('1 2\n3\t4\r5'), '1·2⏎3↹4␍5');
  6. });
  7. });
  8. describe('generateDifferences', () => {
  9. it('operation: insert', () => {
  10. const differences = generateDifferences('abc', 'abcdef');
  11. assert.deepStrictEqual(differences, [
  12. {operation: 'insert', offset: 3, insertText: 'def'},
  13. ]);
  14. });
  15. it('operation: delete', () => {
  16. const differences = generateDifferences('abcdef', 'abc');
  17. assert.deepStrictEqual(differences, [
  18. {operation: 'delete', offset: 3, deleteText: 'def'},
  19. ]);
  20. });
  21. it('operation: replace', () => {
  22. const differences = generateDifferences('abc', 'def');
  23. assert.deepStrictEqual(differences, [
  24. {operation: 'replace', offset: 0, deleteText: 'abc', insertText: 'def'},
  25. ]);
  26. });
  27. });