Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 3c1b236

Browse files
committed
Add failing test for incorrect mid-block summary
1 parent 5868834 commit 3c1b236

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

server/bleep/src/agent/transcoder.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,4 +1040,31 @@ quux";
10401040
assert_eq!(limit_tokens("fn 🚨() {}", bpe.clone(), 5), "fn 🚨()");
10411041
assert_eq!(limit_tokens("fn 🚨() {}", bpe, 6), "fn 🚨() {}");
10421042
}
1043+
1044+
#[test]
1045+
fn test_mid_block_summary() {
1046+
let input = "Dummy code block:
1047+
1048+
<GeneratedCode>
1049+
<Code>
1050+
println!(\"[^summary]\");
1051+
</Code>
1052+
<Language>Rust</Language>
1053+
</GeneratedCode>
1054+
1055+
Foo *bar* quux. [^summary]: Baz fred **thud** corge.\n\n";
1056+
1057+
let expected = "Dummy code block:
1058+
1059+
``` type:Generated,lang:Rust,path:,lines:0-0
1060+
println!(\"[^summary]\");
1061+
```
1062+
1063+
Foo *bar* quux.";
1064+
1065+
let (body, conclusion) = decode(input);
1066+
1067+
assert_eq!(expected, body);
1068+
assert_eq!("Baz fred **thud** corge.", conclusion.unwrap());
1069+
}
10431070
}

0 commit comments

Comments
 (0)