From 36f7fac92a95d03700fa607184720de6d805c74a Mon Sep 17 00:00:00 2001 From: Valentin Kuznetsov Date: Sat, 24 Aug 2024 09:15:05 -0400 Subject: [PATCH] New test file for cric.go --- cric_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cric_test.go diff --git a/cric_test.go b/cric_test.go new file mode 100644 index 0000000..1436b7d --- /dev/null +++ b/cric_test.go @@ -0,0 +1,15 @@ +package cmsauth + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// TestGetSortedDN function +func TestGetSortedDN(t *testing.T) { + dn := "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=user/CN=123/CN=First Last" + expect := "/CN=123/CN=First Last/CN=user/DC=cern/DC=ch/OU=Organic Units/OU=Users" + sortedDN := GetSortedDN(dn) + assert.Equal(t, sortedDN, expect) +}