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
1.8 KiB44 linesraw
1import { extractSearchQuery, extractSearchResults } from '$lib/utils/search-results';
2import { describe, expect, it } from 'vitest';
3
4const SAMPLE = `Title: World Cup 2026 | Match schedule, fixtures, results & stadiums
5URL: https://www.fifa.com/en/tournaments/mens/worldcup/canadamexicousa2026/articles/match-schedule-fixtures-results-teams-stadiums
6Published: 2026-06-22T00:01:00.000Z
7Author: N/A
8Highlights:
9Find out the full match schedule for World Cup 2026 in Canada, Mexico and USA with fixtures and results from each of the 104 games in the ...
10---
11Title: 2026 FIFA World Cup match schedule: Fixtures, results, features - ESPN
12URL: https://www.espn.com/soccer/story/_/id/48939282/2026-fifa-world-cup-fixtures-results-match-schedule-group-stage-knockout-rounds-bracket
13Published: 2026-07-08T07:07:00.000Z
14Author: ESPN
15Highlights:
16Round of 32 · Tuesday, July 7 · Argentina 3-2 Egypt (Atlanta) Switzerland (4) 0-0 (3) Colombia (Vancouver, Canada) · Monday, July 6 · Portugal 0-1 ...
17---
18Title: BBC
19URL: https://www.bbc.co.uk/sport/football/world-cup/schedule
20Published: N/A
21Author: N/A
22Highlights:
23Something
24# World Cup
25...`;
26const QUERY_ARGS = '{"query":"FIFA World Cup 2026 schedule"}';
27
28describe('real-world Exa fixture', () => {
29	it('extracts every search result and preserves rich highlights', () => {
30		const results = extractSearchResults(SAMPLE);
31
32		expect(results.length).toBe(3);
33		expect(results[0].title).toContain('World Cup 2026 | Match schedule');
34		expect(results[0].url).toContain('fifa.com');
35		expect(results[1].title).toContain('2026 FIFA World Cup match schedule');
36		expect(results[1].author).toBe('ESPN');
37		expect(results[1].highlights).toContain('Round of 32');
38		expect(results[2].title).toBe('BBC');
39	});
40
41	it('parses the query out of the tool-args JSON', () => {
42		expect(extractSearchQuery(QUERY_ARGS)).toBe('FIFA World Cup 2026 schedule');
43	});
44});