29 lines
No EOL
795 B
Rust
29 lines
No EOL
795 B
Rust
//! Unit tests migrated from src/basic/keywords/file_operations.rs
|
|
//! These tests were originally in botserver and have been migrated to bottest.
|
|
|
|
#![allow(unused_imports)]
|
|
#![allow(unused_variables)]
|
|
#![allow(dead_code)]
|
|
|
|
use rhai::Dynamic;
|
|
|
|
// Original: use super::*; - tests used internal functions from botserver
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_dynamic_to_json() {
|
|
let dynamic = Dynamic::from("hello");
|
|
let json = dynamic_to_json(&dynamic);
|
|
assert_eq!(json, Value::String("hello".to_string()));
|
|
}
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_dynamic_to_file_data() {
|
|
let dynamic = Dynamic::from("test content");
|
|
let file_data = dynamic_to_file_data(&dynamic);
|
|
assert_eq!(file_data.filename, "file");
|
|
assert!(!file_data.content.is_empty());
|
|
} |