You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert_eq!(processed, expected.trim().to_string(),"Failed for input: {}", input);
3855
3763
}
3856
3764
}
3857
-
3858
-
#[tokio::test]
3859
-
asyncfntest_draw_tip_box(){
3860
-
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
3861
-
let buf = Arc::new(std::sync::Mutex::new(Vec::<u8>::new()));
3862
-
let test_writer = TestWriterWithSink{sink: buf.clone()};
3863
-
let output = SharedWriter::new(test_writer.clone());
3864
-
let tool_manager = ToolManager::default();
3865
-
let tool_config = serde_json::from_str::<HashMap<String,ToolSpec>>(include_str!("tools/tool_index.json"))
3866
-
.expect("Tools failed to load");
3867
-
let test_client = create_stream(serde_json::json!([]));
3868
-
3869
-
letmut chat_context = ChatContext::new(
3870
-
Arc::clone(&ctx),
3871
-
"fake_conv_id",
3872
-
Settings::new(),
3873
-
State::new(),
3874
-
output,
3875
-
None,
3876
-
InputSource::new_mock(vec![]),
3877
-
true,
3878
-
test_client,
3879
-
|| Some(80),
3880
-
tool_manager,
3881
-
None,
3882
-
tool_config,
3883
-
ToolPermissions::new(0),
3884
-
)
3885
-
.await
3886
-
.unwrap();
3887
-
3888
-
// Test with a short tip
3889
-
let short_tip = "This is a short tip";
3890
-
chat_context.draw_tip_box(short_tip).expect("Failed to draw tip box");
3891
-
3892
-
// Test with a longer tip that should wrap
3893
-
let long_tip = "This is a much longer tip that should wrap to multiple lines because it exceeds the inner width of the tip box which is calculated based on the GREETING_BREAK_POINT constant";
3894
-
chat_context.draw_tip_box(long_tip).expect("Failed to draw tip box");
3895
-
3896
-
// Test with a long tip with two long words that should wrap
0 commit comments