You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hydrus-api-rs/tests/wrapper/test_or_chain.rs

27 lines
836 B
Rust

use super::super::common;
use hydrus_api::wrapper::builders::or_chain_builder::OrChainBuilder;
use hydrus_api::wrapper::builders::tag_builder::TagBuilder;
use hydrus_api::wrapper::or_chain::OrChain;
#[test]
fn it_parses_from_string() {
common::setup();
let chain_string =
"'character:megumin' or 'character:aqua' OR '-character:hatsune miku'or 'terminator'";
let chain = OrChain::from(chain_string);
assert_eq!(
chain,
OrChainBuilder::new()
.add_tag("character:megumin".into())
.add_tag("character:aqua".into())
.add_tag(
TagBuilder::new("hatsune miku")
.namespace("character")
.negate()
.build()
)
.add_tag("terminator".into())
.build()
);
}