Skip to content

Commit

Permalink
Move tests folder out of src/
Browse files Browse the repository at this point in the history
  • Loading branch information
brycx committed Aug 29, 2018
1 parent cc03fbe commit 21713dc
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 51 deletions.
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ pub mod default;

/// Low-level API.
pub mod hazardous;

/// Testing module for orion.
#[cfg(test)]
pub mod tests;
39 changes: 0 additions & 39 deletions src/tests/mod.rs

This file was deleted.

4 changes: 3 additions & 1 deletion src/tests/custom_hkdf.rs → tests/custom_hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
mod custom_hkdf {

extern crate hex;
extern crate orion;

use self::hex::decode;
use hazardous::hkdf::*;
use self::orion::hazardous::hkdf::*;

fn hkdf_test_runner(
excp_okm: &[u8],
Expand Down
4 changes: 3 additions & 1 deletion src/tests/custom_pbkdf2.rs → tests/custom_pbkdf2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
mod custom_test_vectors {

extern crate hex;
extern crate orion;

use self::hex::decode;
use hazardous::pbkdf2::*;
use self::orion::hazardous::pbkdf2::*;

#[test]
fn sha512_test_case_1() {
Expand Down
8 changes: 5 additions & 3 deletions src/tests/nist_hmac.rs → tests/nist_hmac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

// Testing against NIST CAVP HMACVS test vectors
extern crate ring;
extern crate orion;

use self::ring::{error, test};
use hazardous::hmac;
use self::orion::hazardous::hmac;

fn hmac_test_runner(
key: &[u8],
Expand Down Expand Up @@ -45,8 +47,8 @@ fn hmac_test_runner(
}

#[test]
fn hmac_tests() {
test::from_file("src/tests/test_data/HMAC_fmt.rsp", |section, test_case| {
fn nist_hmac() {
test::from_file("tests/test_data/HMAC_fmt.rsp", |section, test_case| {
assert_eq!(section, "");
let digest_alg = test_case.consume_string("HMAC");
let key_value = test_case.consume_bytes("Key");
Expand Down
4 changes: 3 additions & 1 deletion src/tests/official_cshake.rs → tests/official_cshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
#[cfg(test)]
mod kcp_test_vectors {

use hazardous::cshake;
extern crate orion;

use self::orion::hazardous::cshake;

#[test]
fn cshake_256_test_case_1() {
Expand Down
4 changes: 3 additions & 1 deletion src/tests/other_hkdf.rs → tests/other_hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
mod other_hkdf {

extern crate hex;
extern crate orion;

use self::hex::decode;
use hazardous::hkdf::*;
use self::orion::hazardous::hkdf::*;

fn hkdf_test_runner(
excp_prk: &[u8],
Expand Down
4 changes: 3 additions & 1 deletion src/tests/rfc_hmac.rs → tests/rfc_hmac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
mod rfc4231 {

extern crate hex;
extern crate orion;

use self::hex::decode;
use hazardous::hmac;
use self::orion::hazardous::hmac;

fn hmac_test_runner(
secret_key: &[u8],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 21713dc

Please sign in to comment.