-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add data #12
test: add data #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! cargo test
works for me and it looks good I have one nitpick, but feel free to ignore.
nitpick: I would avoid complexity qualifiers ("simple") in test names and only name the function after what the test does. (e.g.: simple_encryption
-> encrypt_nt_file
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff. Not much to add, there will come more for sure.
You are doing quite well, seriously. Starting from zero! Well done.
Some nitpicks for later.
You can directly merge this and optionally correct the nitpicks on a new PR if you want.
src/io.rs
Outdated
let input: &[u8] = "<http://example.org/resource2> <http://example.org/relatedTo> <http://example.org/resource3> .\n".as_bytes(); | ||
let buffer_input: Box<dyn BufRead> = Box::new(BufReader::new(input)); | ||
parse_ntriples(buffer_input).for_each(|t| { | ||
assert_eq!(t.subject, "A"); // to replace with http://example.org/resource2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! but shouldnt it be http://example.com... in the assert? You wanted it to fail for me to test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the parse.nt
function is turning any triple into "A", "B" and "C" ;)
That's why the test fails when using what's commented right now
https://github.com/sdsc-ordes/rdf-protect/blob/b00e799ed997d335739226e73430403a89d9d0ef/src/model.rs#L58-L62
src/pass_second.rs
Outdated
// Test the parsing of a triple. | ||
fn simple_encryption() { | ||
let input_path = Path::new("tests/data/test.nt"); | ||
let output_path = Path::new("tests/data/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the output path should be a file or -
to specify stdout
, should be documented probably on the function, sorry didnt wrote that yet.
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Cyril Matthey-Doret <cyril.mattheydoret@gmail.com>
Signed-off-by: Gabriel Nützi <gnuetzi@gmail.com>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com> Co-authored-by: Cyril Matthey-Doret <cyril.mattheydoret@gmail.com> Co-authored-by: Gabriel Nützi <gabriel.nuetzi@sdsc.ethz.ch>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com> Co-authored-by: Cyril Matthey-Doret <cyril.mattheydoret@gmail.com> Co-authored-by: Gabriel Nützi <gabriel.nuetzi@sdsc.ethz.ch>
Co-authored-by: Gabriel Nützi <gnuetzi@gmail.com> Co-authored-by: Cyril Matthey-Doret <cyril.mattheydoret@gmail.com> Co-authored-by: Gabriel Nützi <gabriel.nuetzi@sdsc.ethz.ch>
Addresses #3 and #6.
It would be great if you could run a
cargo test
on your end to see if everything works.Any code recommendations are more than welcome.
Major
io
andpass_second
test.nt
includes elements that either do need encryption. Specifically:Has a
name
predicate but should not be encrypted since Bank is not aPerson
.Minor
Triple
struct are now public in order for the tests to access them