add failing test (failed to find morphism instance)
This commit is contained in:
parent
a9967f8183
commit
78c83cc481
1 changed files with 32 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
use {
|
||||
crate::{dict::*, morphism::*, morphism_base::*, morphism_base_sugared::SugaredMorphismBase, morphism_path::*, morphism_path_sugared::SugaredShortestPathProblem, morphism_sugared::{MorphismInstance2, SugaredMorphism, SugaredMorphismType}, parser::*, unparser::*, SugaredTypeTerm, TypeTerm}
|
||||
crate::{dict::*, morphism::*, morphism_base::*, morphism_base_sugared::SugaredMorphismBase, morphism_path::*, morphism_path_sugared::SugaredShortestPathProblem, morphism_sugared::{MorphismInstance2, SugaredMorphism, SugaredMorphismType}, parser::*, unparser::*, SugaredTypeTerm, TypeTerm}, std::collections::HashMap
|
||||
};
|
||||
|
||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>\\
|
||||
|
@ -339,6 +339,37 @@ fn test_morphism_path_posint() {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn morphism_test_seq_repr() {
|
||||
let mut dict = BimapTypeDict::new();
|
||||
let mut base = SugaredMorphismBase::<DummyMorphism>::new();
|
||||
|
||||
base.add_morphism(
|
||||
DummyMorphism(SugaredMorphismType{
|
||||
src_type: dict.parse("<Seq~<ValueTerminated 0> native.UInt8>").unwrap().sugar(&mut dict),
|
||||
dst_type: dict.parse("<Seq~<LengthPrefix native.UInt64> native.UInt8>").unwrap().sugar(&mut dict)
|
||||
})
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
base.get_morphism_instance(&SugaredMorphismType {
|
||||
src_type: dict.parse("<Seq~<ValueTerminated 0> Char~Ascii~native.UInt8>").expect("parse").sugar(&mut dict),
|
||||
dst_type: dict.parse("<Seq~<LengthPrefix native.UInt64> Char~Ascii~native.UInt8>").expect("parse").sugar(&mut dict)
|
||||
}),
|
||||
Some(
|
||||
MorphismInstance2::Primitive {
|
||||
ψ: dict.parse("<Seq Char~Ascii>").expect("").sugar(&mut dict),
|
||||
σ: HashMap::new(),
|
||||
morph: DummyMorphism(SugaredMorphismType{
|
||||
src_type: dict.parse("<Seq~<ValueTerminated 0> native.UInt8>").unwrap().sugar(&mut dict),
|
||||
dst_type: dict.parse("<Seq~<LengthPrefix native.UInt64> native.UInt8>").unwrap().sugar(&mut dict)
|
||||
})
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn test_steiner_tree() {
|
||||
|
|
Loading…
Add table
Reference in a new issue