From e1b183ded24be0fa043f651a4c7518a1f69bd8f0 Mon Sep 17 00:00:00 2001 From: hslam <791874158@qq.com> Date: Fri, 27 Nov 2020 17:09:01 +0800 Subject: [PATCH] add ftok test --- ftok_test.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ftok_test.go diff --git a/ftok_test.go b/ftok_test.go new file mode 100644 index 0000000..d9fae1a --- /dev/null +++ b/ftok_test.go @@ -0,0 +1,29 @@ +// Copyright (c) 2020 Meng Huang (mhboy@outlook.com) +// This package is licensed under a MIT license that can be found in the LICENSE file. + +package ftok + +import ( + "testing" +) + +func TestFtok(t *testing.T) { + key, err := Ftok("/tmp", 0x22) + if err != nil { + t.Error(err) + } + key1, err := Ftok("/tmp", 0x22) + if err != nil { + t.Error(err) + } + if key != key1 && key <= 0 { + t.Error(key, key1) + } +} + +func TestStat(t *testing.T) { + _, err := Ftok("/tmp/hslam", 0x22) + if err == nil { + t.Error() + } +}