char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Linting & Formatting scripts (#26819)92d1bb0c9

char/aliceai-t5-moe
606 B20 linesraw
1import { redactValue } from '$lib/utils/redact';
2import { describe, expect, it } from 'vitest';
3
4describe('redactValue', () => {
5	it('returns [redacted] by default', () => {
6		expect(redactValue('secret-token')).toBe('[redacted]');
7	});
8
9	it('shows last N characters when showLastChars is provided', () => {
10		expect(redactValue('session-abc12', 5)).toBe('....abc12');
11	});
12
13	it('handles value shorter than showLastChars', () => {
14		expect(redactValue('ab', 5)).toBe('....ab');
15	});
16
17	it('returns [redacted] when showLastChars is 0', () => {
18		expect(redactValue('secret', 0)).toBe('[redacted]');
19	});
20});