File: allow_missing.rs

package info (click to toggle)
rust-rust-embed 8.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,176 kB
  • sloc: javascript: 4; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::{path::PathBuf, str::FromStr};

use rust_embed::Embed;

#[derive(Embed)]
#[folder = "examples/missing/"]
#[allow_missing = true]
struct Asset;

#[test]
fn missing_is_empty() {
  let path = PathBuf::from_str("./examples/missing").unwrap();
  assert!(!path.exists());
  assert_eq!(Asset::iter().count(), 0);
}