<commit_before>#[macro_use]
extern crate askama;

use askama::Template;

#[derive(Template)]
#[template(source = "{{ self.get_s() }}", ext = "txt")]
struct MethodTemplate<'a> {
    s: &'a str,
}

impl<'a> MethodTemplate<'a> {
    fn get_s(&self) -> &str {
        self.s
    }
}

#[derive(Template)]
#[template(source = "{{ self.get_s() }} {{ t.get_s() }}", ext = "txt")]
struct NestedMethodTemplate<'a> {
    t: MethodTemplate<'a>,
}

impl<'a> NestedMethodTemplate<'a> {
    fn get_s(&self) -> &str {
        "bar"
    }
}

#[test]
fn test_method() {
    let t = MethodTemplate { s: "foo" };
    assert_eq!(t.render().unwrap(), "foo");
}

#[test]
fn test_nested() {
    let t = NestedMethodTemplate {
        t: MethodTemplate { s: "foo" },
    };
    assert_eq!(t.render().unwrap(), "bar foo");<commit_msg>Reformat and rename method testing tests for better organization<commit_after>#[macro_use]
extern crate askama;

use askama::Template;

#[derive(Template)]
#[template(source = "{{ self.get_s() }}", ext = "txt")]
struct SelfMethodTemplate<'a> {
    s: &'a str,
}

impl<'a> SelfMethodTemplate<'a> {
    fn get_s(&self) -> &str {
        self.s
    }
}

#[test]
fn test_self_method() {
    let t = SelfMethodTemplate { s: "foo" };
    assert_eq!(t.render().unwrap(), "foo");
}


#[derive(Template)]
#[template(source = "{{ self.get_s() }} {{ t.get_s() }}", ext = "txt")]
struct NestedSelfMethodTemplate<'a> {
    t: SelfMethodTemplate<'a>,
}

impl<'a> NestedSelfMethodTemplate<'a> {
    fn get_s(&self) -> &str {
        "bar"
    }
}

#[test]
fn test_nested() {
    let t = NestedSelfMethodTemplate {
        t: SelfMethodTemplate { s: "foo" },
    };
    assert_eq!(t.render().unwrap(), "bar foo");
{'fraction_non_alphanumeric': 0.2064516129032258, 'fraction_numerical': 0.0, 'mean_word_length': 3.610810810810811, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4859427', 'n_tokens_mistral': 626, 'n_tokens_neox': 655, 'n_words': 129}