feat(round-memory): version-diff + round-memory-store (SP2a)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { diffLines } from './version-diff.mjs';
|
||||
|
||||
describe('diffLines', () => {
|
||||
it('добавленные строки помечает +', () => {
|
||||
const d = diffLines('a\nb', 'a\nb\nc');
|
||||
expect(d).toContain('+ c');
|
||||
});
|
||||
it('удалённые строки помечает -', () => {
|
||||
const d = diffLines('a\nb\nc', 'a\nc');
|
||||
expect(d).toContain('- b');
|
||||
});
|
||||
it('идентичные тексты → пустой diff', () => {
|
||||
expect(diffLines('a\nb', 'a\nb').trim()).toBe('');
|
||||
});
|
||||
it('пустой/нестроковый вход не кидает', () => {
|
||||
expect(() => diffLines('', '')).not.toThrow();
|
||||
expect(() => diffLines(null, undefined)).not.toThrow();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user