From c43d537d5bb0eeb491153b00cdefcb54a6178187 Mon Sep 17 00:00:00 2001 From: ned Date: Sun, 23 Nov 2014 12:03:05 -0700 Subject: Implemented other LDAP server operations (add/delete/modify/extended/etc.) and tests. --- filter_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'filter_test.go') diff --git a/filter_test.go b/filter_test.go index fb54905..2e62f25 100644 --- a/filter_test.go +++ b/filter_test.go @@ -111,3 +111,27 @@ func BenchmarkFilterDecompile(b *testing.B) { DecompileFilter(filters[i%maxIdx]) } } + +func TestGetFilterObjectClass(t *testing.T) { + c, err := GetFilterObjectClass("(objectClass=*)") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "" { + t.Errorf("GetFilterObjectClass failed") + } + c, err = GetFilterObjectClass("(objectClass=posixAccount)") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "posixaccount" { + t.Errorf("GetFilterObjectClass failed") + } + c, err = GetFilterObjectClass("(&(cn=awesome)(objectClass=posixGroup))") + if err != nil { + t.Errorf("GetFilterObjectClass failed") + } + if c != "posixgroup" { + t.Errorf("GetFilterObjectClass failed") + } +} -- cgit v1.2.3