Compare commits

...

2 Commits
v0.7.1 ... main

Author SHA1 Message Date
Cadey Ratio e94e032942 argh
continuous-integration/drone/push Build is passing Details
2020-10-25 16:16:56 -04:00
Cadey Ratio 5c48459414 use rust from reg.tulpa.dev
continuous-integration/drone/push Build is failing Details
2020-10-25 16:01:34 -04:00
3 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,7 @@ name: tests/release
steps:
- name: rust tests
image: "rust:1"
image: "reg.tulpa.dev/rust:1"
pull: always
commands:
- cargo test --all

View File

@ -47,6 +47,7 @@ mod tests {
#[test]
fn read() {
use super::read;
let _ = pretty_env_logger::try_init();
read().unwrap().unwrap();
}
}

View File

@ -4,7 +4,13 @@ use std::{fs, path::PathBuf};
mod cargo;
pub(crate) fn read(fname: PathBuf) -> Result<String> {
let version = read_fs(fname).unwrap_or(cargo::read().unwrap().unwrap());
let version = match read_fs(fname.clone()) {
Ok(version) => version,
Err(why) => {
log::debug!("can't read {:?}: {:?}", fname, why);
cargo::read().unwrap().unwrap()
}
};
Ok(version)
}
@ -17,6 +23,7 @@ fn read_fs(fname: PathBuf) -> Result<String> {
mod tests {
#[test]
fn read_version() {
let _ = pretty_env_logger::try_init();
let version = super::read_fs("./testdata/VERSION".into()).unwrap();
assert_eq!(version, "0.1.0");
}