Compare commits
No commits in common. "9596694941a29c2423826c0f73f745411b9c89cd" and "5ba61ba02642b6532c275143a591182fb1d2f96b" have entirely different histories.
9596694941
...
5ba61ba026
17
.drone.yml
17
.drone.yml
@ -1,17 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: rust
|
|
||||||
environment:
|
|
||||||
SECRET_INPUT:
|
|
||||||
from_secret: secret_input
|
|
||||||
commands:
|
|
||||||
- cargo build --verbose --all
|
|
||||||
- cargo test --verbose --all
|
|
||||||
# Simple test
|
|
||||||
- 'echo "Input: $SECRET_INPUT"'
|
|
||||||
- cargo run $SECRET_INPUT > output
|
|
||||||
- 'echo "Output: " && cat output'
|
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -11,8 +11,3 @@ Cargo.lock
|
|||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Added by cargo
|
|
||||||
|
|
||||||
/target
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "ci-test"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["KAAAsS <admin@kaaass.net>"]
|
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
18
src/lib.rs
18
src/lib.rs
@ -1,18 +0,0 @@
|
|||||||
pub fn reverse(s : &str) -> String {
|
|
||||||
s.chars().rev().collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_reverse() {
|
|
||||||
let query = "hello";
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
"olleh",
|
|
||||||
reverse(query)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
11
src/main.rs
11
src/main.rs
@ -1,11 +0,0 @@
|
|||||||
use std::env;
|
|
||||||
use ci_test::reverse;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
// Read from argument
|
|
||||||
let args: Vec<String> = env::args().collect();
|
|
||||||
if args.len() < 2 {
|
|
||||||
panic!("argument invalid");
|
|
||||||
}
|
|
||||||
println!("{}", reverse(&args[1]));
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user