- (should (equal "Dict<TKey, TValue>"
- (overlay-get (company-template-field-at) 'display))))))
+ (company-template-field-assert-text "Dict<TKey, TValue>"))))
+
+(ert-deftest company-template-c-like-func-ptr ()
+ (with-temp-buffer
+ (let ((text "foo(*)(int)"))
+ (insert text)
+ (company-template-c-like-templatify text)
+ (should (equal (buffer-string) "foo(int)"))
+ (company-template-field-assert-text "int"))))
+
+(ert-deftest company-clang-objc-templatify-empty-args ()
+ (with-temp-buffer
+ (let ((text "createBookWithTitle:andAuthor:"))
+ (insert text)
+ (company-template-objc-templatify text)
+ (should (equal "createBookWithTitle:arg0 andAuthor:arg1" (buffer-string)))
+ (should (looking-at "arg0"))
+ (should (null (overlay-get (company-template-field-at) 'display))))))
+
+(ert-deftest company-template-objc-templatify ()
+ (with-temp-buffer
+ (let ((text "createBookWithTitle:(NSString) andAuthor:(id)"))
+ (insert text)
+ (company-template-objc-templatify text)
+ (should (equal (buffer-string) text))
+ (company-template-field-assert-text "(NSString)"))))