codetether-rlm 0.1.0

Recursive Language Model processing for CodeTether
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::sample;
use crate::oracle::tree_sitter_oracle::TreeSitterOracle;

#[test]
fn get_functions_finds_all() {
    let mut oracle = TreeSitterOracle::new(sample::rust_code());
    let functions = oracle.get_functions().unwrap();
    assert!(functions.len() >= 3);

    let names: Vec<&str> = functions.iter().map(|f| f.name.as_str()).collect();
    assert!(names.contains(&"new"));
    assert!(names.contains(&"with_debug"));
    assert!(names.contains(&"process"));
    assert!(names.contains(&"parse"));
}