aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-11 13:30:39 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-11 14:32:01 +0100
commitd2f9e204aacc13c6205a3d0f1022d4fd17073a7b (patch)
tree57888e0fd6aa03c11b5bf73fdbc26b6a8db5ab0b /tests
parent77ab66e0c0aca2ee77b64297eeaf609922f2007b (diff)
downloadnitrokey-rs-d2f9e204aacc13c6205a3d0f1022d4fd17073a7b.tar.gz
nitrokey-rs-d2f9e204aacc13c6205a3d0f1022d4fd17073a7b.tar.bz2
Add the get_library_version function
This patch adds the get_library_version function to the main library module that queries and returns the libnitrokey version. As the version fields are static values, we fetch them all at the same time and do not provide getters for the individual fields.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib.rs b/tests/lib.rs
new file mode 100644
index 0000000..06de0ad
--- /dev/null
+++ b/tests/lib.rs
@@ -0,0 +1,8 @@
+#[test]
+fn get_library_version() {
+ let version = nitrokey::get_library_version();
+
+ assert!(!version.git.is_empty());
+ assert!(version.git.starts_with("v"));
+ assert!(version.major > 0);
+}