]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
unit tests for case preservation
authorAlejandro R Sedeño <asedeno@google.com>
Tue, 12 Feb 2013 17:56:20 +0000 (12:56 -0500)
committerAlejandro R Sedeño <asedeno@google.com>
Tue, 12 Feb 2013 18:01:12 +0000 (13:01 -0500)
tests/case-preservation-test.lisp [new file with mode: 0644]
tests/case-preservation.proto [new file with mode: 0644]
tests/cl-protobufs-tests.asd

diff --git a/tests/case-preservation-test.lisp b/tests/case-preservation-test.lisp
new file mode 100644 (file)
index 0000000..51ecaf5
--- /dev/null
@@ -0,0 +1,25 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;                                                                  ;;;
+;;; Free Software published under an MIT-like license. See LICENSE   ;;;
+;;;                                                                  ;;;
+;;; Copyright (c) 2013 Google, Inc.  All rights reserved.            ;;;
+;;;                                                                  ;;;
+;;; Original author: Alejandro Sedeño                                ;;;
+;;;                                                                  ;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(in-package "PROTO-TEST")
+
+(define-test case-preservation-test ()
+  (let ((service (proto:find-service :case-preservation "QUUXService")))
+    (assert-true service)
+    ;; We're reaching into the implementation to verify the objects have
+    ;; been properly constructed.
+    (let ((method (proto-impl:find-method service "QUUXMethod")))
+      (assert-true method)
+      (assert-equal (proto-input-name method) "QUUXRequest"
+                    :test #'string=)
+      (assert-equal (proto-output-name method) "QUUXResponse"
+                    :test #'string=))))
+
+(register-test 'case-preservation-test)
diff --git a/tests/case-preservation.proto b/tests/case-preservation.proto
new file mode 100644 (file)
index 0000000..282bf67
--- /dev/null
@@ -0,0 +1,18 @@
+// Free Software published under an MIT-like license. See LICENSE
+//
+// Copyright (c) 2013 Google, Inc.  All rights reserved.
+//
+// Original author: Alejandro R Sedeño
+
+syntax = "proto2";
+
+package protobuf_case_preservation_unittest;
+
+// Test case preservation for messages and services.
+
+message QUUXRequest {}
+message QUUXResponse {}
+
+service QUUXService {
+  rpc QUUXMethod(QUUXRequest) returns (QUUXResponse);
+}
index 15e3331a377d11aec3daa619dc68fb1af4209f7f..0c31f7c49beb7dcf882daa77257a58733e5c5db6 100644 (file)
                ((:protobuf-file "extend-test")
                 (:file "lisp-extend-test")))
 
+     (module "case-preservation-test"
+             :serial t
+             :pathname #p""
+             :components
+               ((:protobuf-file "case-preservation")
+                (:file "case-preservation-test")))
+
      ;; Google's own protocol buffers and protobuf definitions tests
      #+++notyet
      (:module "google-tests-proto"