Skip to content

Commit 805545f

Browse files
committed
feat: add tests
1 parent 0dece42 commit 805545f

File tree

10 files changed

+109
-1
lines changed

10 files changed

+109
-1
lines changed

lib/msgfmt/msgfmt_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func TestTrimEmptyLines(t *testing.T) {
218218

219219
func TestFormatAgentMessage(t *testing.T) {
220220
dir := "testdata/format"
221-
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeCodex, AgentTypeCustom}
221+
agentTypes := []AgentType{AgentTypeClaude, AgentTypeGoose, AgentTypeAider, AgentTypeGemini, AgentTypeCodex, AgentTypeCustom}
222222
for _, agentType := range agentTypes {
223223
t.Run(string(agentType), func(t *testing.T) {
224224
cases, err := testdataDir.ReadDir(path.Join(dir, string(agentType)))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Tips for getting started:
2+
1. Ask questions, edit files, or run commands.
3+
2. Be specific for the best results.
4+
3. Create GEMINI.md files to customize your interactions with Gemini.
5+
4. /help for more information.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Tips for getting started:
2+
1. Ask questions, edit files, or run commands.
3+
2. Be specific for the best results.
4+
3. Create GEMINI.md files to customize your interactions with Gemini.
5+
4. /help for more information.
6+
7+
8+
9+
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
10+
│ > Type your message or @path/to/file │
11+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
12+
13+
~/Documents/work/agentapi (feat-claude-cli*) no sandbox (see /docs) gemini-2.5-pro (100% context left)

lib/msgfmt/testdata/format/gemini/first_message/user.txt

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
2+
│ ✔ SearchText 'setInterval\(fetchMessages, 1000\)' in **/*.tsx │
3+
│ │
4+
│ No matches found │
5+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
6+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
7+
│ ✔ SearchText 'checkServerStatus, 250' in **/*.tsx │
8+
│ │
9+
│ No matches found │
10+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
11+
✦ I couldn't find that exact code snippet in the project. It's possible it has been modified or is from a file that wasn't included in the initial project listing.
12+
13+
To help me locate it, could you tell me more about what the code does or what component it might be a part of? For example, is it part of the main chat window, a status indicator,
14+
or something else?
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
╭───────────────────────────────────────────────────────────────────╮
2+
│ > Which file is this code from? │
3+
│ │
4+
│ ```ts │
5+
│ // Set up polling for messages and server status │
6+
│ useEffect(() => { │
7+
│ // Check server status initially │
8+
│ checkServerStatus(); │
9+
│ │
10+
│ // Set up polling intervals │
11+
│ const messageInterval = setInterval(fetchMessages, 1000); │
12+
│ const statusInterval = setInterval(checkServerStatus, 250); │
13+
│ │
14+
│ // Clean up intervals on component unmount │
15+
│ return () => { │
16+
│ clearInterval(messageInterval); │
17+
│ clearInterval(statusInterval); │
18+
│ }; │
19+
│ }, []); │
20+
│ ``` │
21+
╰───────────────────────────────────────────────────────────────────╯
22+
23+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
24+
│ ✔ SearchText 'setInterval\(fetchMessages, 1000\)' in **/*.tsx │
25+
│ │
26+
│ No matches found │
27+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
28+
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
29+
│ ✔ SearchText 'checkServerStatus, 250' in **/*.tsx │
30+
│ │
31+
│ No matches found │
32+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
33+
✦ I couldn't find that exact code snippet in the project. It's possible it has been modified or is from a file that wasn't included in the initial project listing.
34+
35+
To help me locate it, could you tell me more about what the code does or what component it might be a part of? For example, is it part of the main chat window, a status indicator,
36+
or something else?
37+
38+
39+
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
40+
│ > Type your message or @path/to/file │
41+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
42+
43+
~/Documents/work/agentapi (feat-claude-cli*) no sandbox (see /docs) gemini-2.5-pro (99% context left)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Which file is this code from?
2+
3+
```ts
4+
// Set up polling for messages and server status
5+
useEffect(() => {
6+
// Check server status initially
7+
checkServerStatus();
8+
9+
// Set up polling intervals
10+
const messageInterval = setInterval(fetchMessages, 1000);
11+
const statusInterval = setInterval(checkServerStatus, 250);
12+
13+
// Clean up intervals on component unmount
14+
return () => {
15+
clearInterval(messageInterval);
16+
clearInterval(statusInterval);
17+
};
18+
}, []);
19+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
✦ I am ready to assist you. What can I help you with?
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
╭──────────────────╮
2+
│ > How are you? │
3+
╰──────────────────╯
4+
5+
✦ I am ready to assist you. What can I help you with?
6+
7+
8+
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
9+
│ > Type your message or @path/to/file │
10+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
11+
12+
~/Documents/work/agentapi (feat-claude-cli*) no sandbox (see /docs) gemini-2.5-pro (99% context left)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
How are you?

0 commit comments

Comments
 (0)