Projects STRLCPY cfonts Commits 39245b2e
🤬
  • ■ ■ ■ ■ ■ ■
    rust/Cargo.lock
    skipped 2 lines
    3 3  version = 3
    4 4   
    5 5  [[package]]
     6 +name = "assert_cmd"
     7 +version = "2.0.4"
     8 +source = "registry+https://github.com/rust-lang/crates.io-index"
     9 +checksum = "93ae1ddd39efd67689deb1979d80bad3bf7f2b09c6e6117c8d1f2443b5e2f83e"
     10 +dependencies = [
     11 + "bstr",
     12 + "doc-comment",
     13 + "predicates",
     14 + "predicates-core",
     15 + "predicates-tree",
     16 + "wait-timeout",
     17 +]
     18 + 
     19 +[[package]]
    6 20  name = "atty"
    7 21  version = "0.2.14"
    8 22  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 5 lines
    14 28  ]
    15 29   
    16 30  [[package]]
     31 +name = "bstr"
     32 +version = "0.2.17"
     33 +source = "registry+https://github.com/rust-lang/crates.io-index"
     34 +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
     35 +dependencies = [
     36 + "lazy_static",
     37 + "memchr",
     38 + "regex-automata",
     39 +]
     40 + 
     41 +[[package]]
    17 42  name = "cfg-if"
    18 43  version = "1.0.0"
    19 44  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 3 lines
    23 48  name = "cfonts"
    24 49  version = "1.0.3"
    25 50  dependencies = [
     51 + "assert_cmd",
    26 52   "enable-ansi-support",
    27 53   "exitcode",
    28 54   "rand",
    skipped 7 lines
    36 62  ]
    37 63   
    38 64  [[package]]
     65 +name = "difflib"
     66 +version = "0.4.0"
     67 +source = "registry+https://github.com/rust-lang/crates.io-index"
     68 +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
     69 + 
     70 +[[package]]
     71 +name = "doc-comment"
     72 +version = "0.3.3"
     73 +source = "registry+https://github.com/rust-lang/crates.io-index"
     74 +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
     75 + 
     76 +[[package]]
     77 +name = "either"
     78 +version = "1.6.1"
     79 +source = "registry+https://github.com/rust-lang/crates.io-index"
     80 +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
     81 + 
     82 +[[package]]
    39 83  name = "enable-ansi-support"
    40 84  version = "0.1.2"
    41 85  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 41 lines
    83 127  checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
    84 128   
    85 129  [[package]]
     130 +name = "itertools"
     131 +version = "0.10.3"
     132 +source = "registry+https://github.com/rust-lang/crates.io-index"
     133 +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
     134 +dependencies = [
     135 + "either",
     136 +]
     137 + 
     138 +[[package]]
    86 139  name = "itoa"
    87 140  version = "1.0.1"
    88 141  source = "registry+https://github.com/rust-lang/crates.io-index"
    89 142  checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
    90 143   
    91 144  [[package]]
     145 +name = "lazy_static"
     146 +version = "1.4.0"
     147 +source = "registry+https://github.com/rust-lang/crates.io-index"
     148 +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
     149 + 
     150 +[[package]]
    92 151  name = "libc"
    93 152  version = "0.2.125"
    94 153  source = "registry+https://github.com/rust-lang/crates.io-index"
    95 154  checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
    96 155   
    97 156  [[package]]
     157 +name = "memchr"
     158 +version = "2.5.0"
     159 +source = "registry+https://github.com/rust-lang/crates.io-index"
     160 +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
     161 + 
     162 +[[package]]
    98 163  name = "once_cell"
    99 164  version = "1.10.0"
    100 165  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 6 lines
    107 172  checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
    108 173   
    109 174  [[package]]
     175 +name = "predicates"
     176 +version = "2.1.1"
     177 +source = "registry+https://github.com/rust-lang/crates.io-index"
     178 +checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c"
     179 +dependencies = [
     180 + "difflib",
     181 + "itertools",
     182 + "predicates-core",
     183 +]
     184 + 
     185 +[[package]]
     186 +name = "predicates-core"
     187 +version = "1.0.3"
     188 +source = "registry+https://github.com/rust-lang/crates.io-index"
     189 +checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb"
     190 + 
     191 +[[package]]
     192 +name = "predicates-tree"
     193 +version = "1.0.5"
     194 +source = "registry+https://github.com/rust-lang/crates.io-index"
     195 +checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032"
     196 +dependencies = [
     197 + "predicates-core",
     198 + "termtree",
     199 +]
     200 + 
     201 +[[package]]
    110 202  name = "proc-macro2"
    111 203  version = "1.0.37"
    112 204  source = "registry+https://github.com/rust-lang/crates.io-index"
    skipped 40 lines
    153 245  dependencies = [
    154 246   "getrandom",
    155 247  ]
     248 + 
     249 +[[package]]
     250 +name = "regex-automata"
     251 +version = "0.1.10"
     252 +source = "registry+https://github.com/rust-lang/crates.io-index"
     253 +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
    156 254   
    157 255  [[package]]
    158 256  name = "rustversion"
    skipped 98 lines
    257 355  ]
    258 356   
    259 357  [[package]]
     358 +name = "termtree"
     359 +version = "0.2.4"
     360 +source = "registry+https://github.com/rust-lang/crates.io-index"
     361 +checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b"
     362 + 
     363 +[[package]]
    260 364  name = "unicode-xid"
    261 365  version = "0.2.2"
    262 366  source = "registry+https://github.com/rust-lang/crates.io-index"
    263 367  checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
     368 + 
     369 +[[package]]
     370 +name = "wait-timeout"
     371 +version = "0.2.0"
     372 +source = "registry+https://github.com/rust-lang/crates.io-index"
     373 +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
     374 +dependencies = [
     375 + "libc",
     376 +]
    264 377   
    265 378  [[package]]
    266 379  name = "wasi"
    skipped 26 lines
  • ■ ■ ■ ■ ■
    rust/Cargo.toml
    skipped 25 lines
    26 26   
    27 27  [dev-dependencies]
    28 28  temp-env = "0.2.0"
     29 +assert_cmd = "2.0.4"
    29 30   
  • ■ ■ ■ ■
    rust/src/font.rs
    skipped 8 lines
    9 9  use crate::debug::{d, Dt};
    10 10   
    11 11  /// The shape of our font data
    12  -#[derive(Debug, Deserialize)]
     12 +#[derive(Deserialize)]
    13 13  pub struct Font {
    14 14   /// The name of our font
    15 15   pub name: String,
    skipped 123 lines
  • ■ ■ ■ ■ ■ ■
    rust/tests/end-to-end_test.rs
    skipped 11 lines
    12 12   extern crate temp_env;
    13 13   
    14 14   use super::*;
    15  - use std::path::Path;
     15 + use assert_cmd::prelude::*;
    16 16   use std::process::Command;
    17 17   
    18 18   #[test]
    skipped 11 lines
    30 30   let no_color_val = if test.no_color { Some(appendix) } else { None };
    31 31   
    32 32   temp_env::with_vars(vec![("FORCE_COLOR", force_color_val), ("NO_COLOR", no_color_val)], || {
    33  - let output = Command::new(Path::new("target/release/cfonts").as_os_str())
    34  - .args(&test.args)
    35  - .output()
    36  - .expect("failed to execute process");
     33 + let output =
     34 + Command::cargo_bin("cfonts").unwrap().args(&test.args).output().expect("failed to execute process");
    37 35   
    38 36   assert_eq!(String::from_utf8_lossy(&output.stdout).to_string() + appendix, test.fixture.clone() + appendix);
    39 37   });
    skipped 1895 lines
  • ■ ■ ■ ■ ■ ■
    rust/tests/lib_test.rs
     1 +extern crate cfonts;
     2 + 
     3 +use cfonts::{say, Options};
     4 + 
     5 +#[cfg(test)]
     6 +mod tests {
     7 + use super::*;
     8 + 
     9 + #[test]
     10 + fn say_works() {
     11 + say(Options {
     12 + text: String::from("hello"),
     13 + ..Options::default()
     14 + });
     15 + }
     16 +}
     17 + 
Please wait...
Page is in error, reload to recover