bottest/tests/unit/basic/basic_keywords_llm_macros.rs

40 lines
No EOL
1 KiB
Rust

//! Unit tests migrated from src/basic/keywords/llm_macros.rs
//! These tests were originally in botserver and have been migrated to bottest.
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(dead_code)]
// Original: use super::*; - tests used internal functions from botserver
#[test]
fn test_parse_calculate_result_integer() {
let result = parse_calculate_result("42").unwrap();
assert_eq!(result.as_int().unwrap(), 42);
}
#[test]
fn test_parse_calculate_result_float() {
let result = parse_calculate_result("3.14").unwrap();
assert!((result.as_float().unwrap() - 3.14).abs() < 0.001);
}
#[test]
fn test_parse_calculate_result_boolean() {
let result = parse_calculate_result("true").unwrap();
assert!(result.as_bool().unwrap());
}
#[test]
fn test_build_translate_prompt() {
let prompt = build_translate_prompt("Hello", "Spanish");
assert!(prompt.contains("Hello"));
assert!(prompt.contains("Spanish"));
}