Fix tests for rename
This commit is contained in:
parent
3a4dce084e
commit
6f337a7379
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
/target
|
||||
**/target
|
||||
/*/metadata.mps.sqlite
|
||||
metadata.mps.sqlite
|
||||
/*/metadata.muss.sqlite
|
||||
metadata.muss.sqlite
|
||||
**.m3u8
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
pub const DEFAULT_SQLITE_FILEPATH: &str = "metadata.sqlite";
|
||||
pub const DEFAULT_SQLITE_FILEPATH: &str = "metadata.muss.sqlite";
|
||||
|
||||
pub trait DatabaseObj: Sized {
|
||||
fn map_row(row: &rusqlite::Row) -> rusqlite::Result<Self>;
|
||||
|
|
|
@ -338,14 +338,22 @@ pub trait FilesystemQuerier: Debug {
|
|||
#[cfg(feature = "shellexpand")]
|
||||
match folder {
|
||||
Some(path) => Ok(Some(
|
||||
shellexpand::full(path)
|
||||
shellexpand::full(self.canonicalize(path))
|
||||
.map_err(|e| RuntimeMsg(format!("Path expansion error: {}", e)))?
|
||||
.into_owned(),
|
||||
)),
|
||||
None => Ok(None),
|
||||
}
|
||||
#[cfg(not(feature = "shellexpand"))]
|
||||
Ok(folder.and_then(|s| Some(s.to_string())))
|
||||
Ok(folder.and_then(|s| Some(self.canonicalize(s).to_string())))
|
||||
}
|
||||
|
||||
fn canonicalize<'a>(&self, path: &'a str) -> &'a str {
|
||||
if let Some(new_path) = path.strip_prefix("file://") {
|
||||
new_path
|
||||
} else {
|
||||
path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#[cfg(feature = "music_library")]
|
||||
mod music_lib_test {
|
||||
use mps_interpreter::music::*;
|
||||
use muss_interpreter::music::*;
|
||||
|
||||
#[test]
|
||||
fn generate_library() {
|
||||
let mut lib = MpsLibrary::new();
|
||||
let mut lib = Library::new();
|
||||
lib.read_path("/home/ngnius/Music", 10).unwrap();
|
||||
println!("generated library size: {}", lib.len());
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
//! Integration tests for every syntax feature
|
||||
|
||||
use mps_interpreter::tokens::{MpsToken, MpsTokenizer, ParseError};
|
||||
use mps_interpreter::*;
|
||||
use muss_interpreter::tokens::{Token, Tokenizer, ParseError};
|
||||
use muss_interpreter::*;
|
||||
use std::collections::VecDeque;
|
||||
use std::io::Cursor;
|
||||
|
||||
#[test]
|
||||
fn parse_line() -> Result<(), ParseError> {
|
||||
let cursor = Cursor::new("sql(`SELECT * FROM songs;`)");
|
||||
let correct_tokens: Vec<MpsToken> = vec![
|
||||
MpsToken::Name("sql".into()),
|
||||
MpsToken::OpenBracket,
|
||||
MpsToken::Literal("SELECT * FROM songs;".into()),
|
||||
MpsToken::CloseBracket,
|
||||
let correct_tokens: Vec<Token> = vec![
|
||||
Token::Name("sql".into()),
|
||||
Token::OpenBracket,
|
||||
Token::Literal("SELECT * FROM songs;".into()),
|
||||
Token::CloseBracket,
|
||||
];
|
||||
|
||||
let mut tokenizer = MpsTokenizer::new(cursor);
|
||||
let mut buf = VecDeque::<MpsToken>::new();
|
||||
let mut tokenizer = Tokenizer::new(cursor);
|
||||
let mut buf = VecDeque::<Token>::new();
|
||||
tokenizer.read_line(&mut buf)?; // operation being tested
|
||||
|
||||
// debug output
|
||||
|
@ -44,7 +44,7 @@ fn execute_single_line(
|
|||
line: &str,
|
||||
should_be_emtpy: bool,
|
||||
should_complete: bool,
|
||||
) -> Result<(), MpsError> {
|
||||
) -> Result<(), InterpreterError> {
|
||||
if line.contains('\n') {
|
||||
println!(
|
||||
"--- Executing MPS code ---\n{}\n--- Executing MPS code ---",
|
||||
|
@ -55,8 +55,8 @@ fn execute_single_line(
|
|||
}
|
||||
let cursor = Cursor::new(line);
|
||||
|
||||
let tokenizer = MpsTokenizer::new(cursor);
|
||||
let interpreter = MpsFaye::with_standard_vocab(tokenizer);
|
||||
let tokenizer = Tokenizer::new(cursor);
|
||||
let interpreter = Interpreter::with_standard_vocab(tokenizer);
|
||||
|
||||
let mut count = 0;
|
||||
for result in interpreter {
|
||||
|
@ -109,23 +109,23 @@ fn execute_single_line(
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_sql_line() -> Result<(), MpsError> {
|
||||
fn execute_sql_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line("sql(`SELECT * FROM songs ORDER BY artist;`)", false, true)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_simple_sql_line() -> Result<(), MpsError> {
|
||||
fn execute_simple_sql_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line("song(`lov`)", false, true)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_comment_line() -> Result<(), MpsError> {
|
||||
fn execute_comment_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line("// this is a comment", true, true)?;
|
||||
execute_single_line("# this is a special comment", true, true)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_repeat_line() -> Result<(), MpsError> {
|
||||
fn execute_repeat_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"repeat(files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`))",
|
||||
false,
|
||||
|
@ -144,7 +144,7 @@ fn execute_repeat_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_sql_init_line() -> Result<(), MpsError> {
|
||||
fn execute_sql_init_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"sql_init(generate = false, folder = `/home/ngnius/Music`)",
|
||||
true,
|
||||
|
@ -153,7 +153,7 @@ fn execute_sql_init_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_assign_line() -> Result<(), MpsError> {
|
||||
fn execute_assign_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"let some_var = repeat(song(`Christmas in L.A.`))",
|
||||
true,
|
||||
|
@ -163,7 +163,7 @@ fn execute_assign_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_emptyfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_emptyfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).().().()",
|
||||
false,
|
||||
|
@ -172,7 +172,7 @@ fn execute_emptyfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_fieldfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_fieldfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(year >= 2000)",
|
||||
false,
|
||||
|
@ -196,7 +196,7 @@ fn execute_fieldfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_fieldfiltermaybe_line() -> Result<(), MpsError> {
|
||||
fn execute_fieldfiltermaybe_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(year? >= 2000)",
|
||||
false,
|
||||
|
@ -220,7 +220,7 @@ fn execute_fieldfiltermaybe_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_files_line() -> Result<(), MpsError> {
|
||||
fn execute_files_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
r"files(folder=`~/Music/MusicFlac/Bruno Mars/24K Magic/`, re=``, recursive=false)",
|
||||
false,
|
||||
|
@ -235,7 +235,7 @@ fn execute_files_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_indexfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_indexfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(2)",
|
||||
false,
|
||||
|
@ -259,7 +259,7 @@ fn execute_indexfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_rangefilter_line() -> Result<(), MpsError> {
|
||||
fn execute_rangefilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(..)",
|
||||
false,
|
||||
|
@ -283,7 +283,7 @@ fn execute_rangefilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_orfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_orfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(4 || 5)",
|
||||
false,
|
||||
|
@ -302,7 +302,7 @@ fn execute_orfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_replacefilter_line() -> Result<(), MpsError> {
|
||||
fn execute_replacefilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(if 4: files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(5))",
|
||||
false,
|
||||
|
@ -321,7 +321,7 @@ fn execute_replacefilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_emptysort_line() -> Result<(), MpsError> {
|
||||
fn execute_emptysort_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).sort()",
|
||||
false,
|
||||
|
@ -335,7 +335,7 @@ fn execute_emptysort_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_likefilter_line() -> Result<(), MpsError> {
|
||||
fn execute_likefilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(not_a_field? like `24K Magic`)",
|
||||
true,
|
||||
|
@ -359,7 +359,7 @@ fn execute_likefilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_fieldsort_line() -> Result<(), MpsError> {
|
||||
fn execute_fieldsort_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(title)",
|
||||
false,
|
||||
|
@ -373,7 +373,7 @@ fn execute_fieldsort_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_blissfirstsort_line() -> Result<(), MpsError> {
|
||||
fn execute_blissfirstsort_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(advanced bliss_first)",
|
||||
false,
|
||||
|
@ -382,7 +382,7 @@ fn execute_blissfirstsort_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_blissnextsort_line() -> Result<(), MpsError> {
|
||||
fn execute_blissnextsort_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(advanced bliss_next)",
|
||||
false,
|
||||
|
@ -391,17 +391,17 @@ fn execute_blissnextsort_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_emptyfn_line() -> Result<(), MpsError> {
|
||||
fn execute_emptyfn_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line("empty()", true, true)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_resetfn_line() -> Result<(), MpsError> {
|
||||
fn execute_resetfn_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line("reset(empty())", true, true)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_shufflesort_line() -> Result<(), MpsError> {
|
||||
fn execute_shufflesort_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`)~(random shuffle)",
|
||||
false,
|
||||
|
@ -416,7 +416,7 @@ fn execute_shufflesort_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_unionfn_line() -> Result<(), MpsError> {
|
||||
fn execute_unionfn_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"union(files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`))",
|
||||
false,
|
||||
|
@ -440,7 +440,7 @@ fn execute_unionfn_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_regexfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_regexfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(title matches `24K\\\\s+Magic`)", // note: quad-escape not required in scripts
|
||||
false,
|
||||
|
@ -460,7 +460,7 @@ fn execute_regexfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_intersectionfn_line() -> Result<(), MpsError> {
|
||||
fn execute_intersectionfn_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"intersection(files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`))",
|
||||
false,
|
||||
|
@ -484,7 +484,7 @@ fn execute_intersectionfn_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_declareitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_declareitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{let x = empty()}",
|
||||
false,
|
||||
|
@ -493,7 +493,7 @@ fn execute_declareitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_removeitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_removeitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{remove item.title, remove item}",
|
||||
true,
|
||||
|
@ -502,7 +502,7 @@ fn execute_removeitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_multiitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_multiitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
let x = empty(),
|
||||
|
@ -515,7 +515,7 @@ fn execute_multiitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_fieldassignitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_fieldassignitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.potato = empty(),
|
||||
|
@ -527,7 +527,7 @@ fn execute_fieldassignitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_constitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_constitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
`str const`,
|
||||
|
@ -542,7 +542,7 @@ fn execute_constitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_retrieveitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_retrieveitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.path = item.filename,
|
||||
|
@ -555,7 +555,7 @@ fn execute_retrieveitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_additemop_line() -> Result<(), MpsError> {
|
||||
fn execute_additemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.title = `TEST` + item.title,
|
||||
|
@ -567,7 +567,7 @@ fn execute_additemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_subtractitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_subtractitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = 1234 - 94,
|
||||
|
@ -578,7 +578,7 @@ fn execute_subtractitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_negateitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_negateitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = 1234,
|
||||
|
@ -591,7 +591,7 @@ fn execute_negateitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_notitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_notitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = false,
|
||||
|
@ -604,7 +604,7 @@ fn execute_notitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_orlogicalitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_orlogicalitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = true || true,
|
||||
|
@ -616,7 +616,7 @@ fn execute_orlogicalitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_andlogicalitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_andlogicalitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = true && true,
|
||||
|
@ -628,7 +628,7 @@ fn execute_andlogicalitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_bracketsitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_bracketsitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.test = true && true && (false || false),
|
||||
|
@ -640,7 +640,7 @@ fn execute_bracketsitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_stringifyitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_stringifyitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.filepath = ~`test out: {test}` item,
|
||||
|
@ -654,7 +654,7 @@ fn execute_stringifyitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_branchitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_branchitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
if false {
|
||||
|
@ -672,7 +672,7 @@ fn execute_branchitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_compareitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_compareitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
if 42 != 42 {
|
||||
|
@ -687,7 +687,7 @@ fn execute_compareitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_computeitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_computeitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
let count = 1,
|
||||
|
@ -706,7 +706,7 @@ fn execute_computeitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_complexitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_complexitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).().{
|
||||
let count = 1,
|
||||
|
@ -725,7 +725,7 @@ fn execute_complexitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_constructitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_constructitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
let other_item = Item (),
|
||||
|
@ -743,7 +743,7 @@ fn execute_constructitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_iteritemop_line() -> Result<(), MpsError> {
|
||||
fn execute_iteritemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item = iter empty()
|
||||
|
@ -754,7 +754,7 @@ fn execute_iteritemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_commentitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_commentitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"empty().{
|
||||
// this is a comment
|
||||
|
@ -767,7 +767,7 @@ fn execute_commentitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_uniquefieldfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_uniquefieldfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"repeat(files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`), 3).(unique title?)",
|
||||
false,
|
||||
|
@ -786,7 +786,7 @@ fn execute_uniquefieldfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_uniquefilter_line() -> Result<(), MpsError> {
|
||||
fn execute_uniquefilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).(unique)",
|
||||
false,
|
||||
|
@ -795,7 +795,7 @@ fn execute_uniquefilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_fileitemop_line() -> Result<(), MpsError> {
|
||||
fn execute_fileitemop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files(`~/Music/MusicFlac/Bruno Mars/24K Magic/`).{
|
||||
item.title = `something else`,
|
||||
|
@ -807,7 +807,7 @@ fn execute_fileitemop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_emptiesop_line() -> Result<(), MpsError> {
|
||||
fn execute_emptiesop_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"empties(1).{let count = 0, item.title = ~`title #{}` count+1, item.filename = ~`filename_{}` count, count = count + 1}",
|
||||
false,
|
||||
|
@ -822,7 +822,7 @@ fn execute_emptiesop_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_nonemptyfilter_line() -> Result<(), MpsError> {
|
||||
fn execute_nonemptyfilter_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"files().(??)",
|
||||
false,
|
||||
|
@ -836,7 +836,7 @@ fn execute_nonemptyfilter_line() -> Result<(), MpsError> {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn execute_mpdfunction_line() -> Result<(), MpsError> {
|
||||
fn execute_mpdfunction_line() -> Result<(), InterpreterError> {
|
||||
execute_single_line(
|
||||
"mpd(`127.0.0.1:6600`, artist=`Bruno Mars`)",
|
||||
false,
|
||||
|
|
|
@ -275,7 +275,7 @@ fn music_filename(item: &Item) -> Option<String> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use mps_interpreter::Interpreter;
|
||||
use muss_interpreter::Interpreter;
|
||||
use std::io;
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
|
Loading…
Reference in a new issue