From 79b7b6b96b4fb1568e11ebf435819a92b92995af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20R=20Sede=C3=B1o?= Date: Tue, 12 Feb 2013 12:56:20 -0500 Subject: [PATCH] unit tests for case preservation --- tests/case-preservation-test.lisp | 25 +++++++++++++++++++++++++ tests/case-preservation.proto | 18 ++++++++++++++++++ tests/cl-protobufs-tests.asd | 7 +++++++ 3 files changed, 50 insertions(+) create mode 100644 tests/case-preservation-test.lisp create mode 100644 tests/case-preservation.proto diff --git a/tests/case-preservation-test.lisp b/tests/case-preservation-test.lisp new file mode 100644 index 0000000..51ecaf5 --- /dev/null +++ b/tests/case-preservation-test.lisp @@ -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 index 0000000..282bf67 --- /dev/null +++ b/tests/case-preservation.proto @@ -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); +} diff --git a/tests/cl-protobufs-tests.asd b/tests/cl-protobufs-tests.asd index 15e3331..0c31f7c 100644 --- a/tests/cl-protobufs-tests.asd +++ b/tests/cl-protobufs-tests.asd @@ -95,6 +95,13 @@ ((: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" -- 2.45.2