You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test.rs
    path of file: ./repos/erg/crates/erg_compiler/context
    
    the code of the file until where you have to start completion: //! test module for `Context`
use erg_common::traits::StructuralEq;
use erg_common::Str;

use crate::ty::constructors::{func1, mono, mono_q, poly, refinement, ty_tp};
use crate::ty::free::Constraint;
use crate::ty::typaram::TyParam;
use crate::ty::{Predicate, Type};
use Type::*;

use crate::context::Context;

impl Context {
    pub fn assert_var_type(&self, varname: &str, ty: &Type) -> Result<(), ()> {
        let Some((_, vi)) = self.get_var_info(varname) else {
            panic!("variable not found: {varname
    
    pub fn test_instantiation_and_generalization(&self) -> Result<(), ()> {
        use crate::ty::free::HasLevel;
        let t = mono_q("T", Constraint::new_subtype_of(mono("Eq")));
        let unbound = func1(t.clone(), t);
        let quantified = unbound.clone().quantify();
        println!("quantified      : {quantified}");
        let inst = self.instantiate_def_type(&unbound).map_err(|_| ())?;
        println!("inst: {inst}");
        inst.lift();
        let quantified_again = self.generalize_t(inst);
        println!("quantified_again: {quantified_again}");
        assert_eq!(quantified, quantified_again);
        Ok(())
    }