]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
Test pure-lisp symbol-based import
authorAlejandro R Sedeño <asedeno@google.com>
Wed, 20 Mar 2013 02:42:28 +0000 (22:42 -0400)
committerAlejandro R Sedeño <asedeno@google.com>
Wed, 20 Mar 2013 03:35:40 +0000 (23:35 -0400)
tests/cl-protobufs-tests.asd
tests/symbol-import-tests.lisp [new file with mode: 0644]

index 6ef69f41b39d70e33f4e544bdbb56357afb0fa86..fd1f04c0cef576c0664de4aab79f155c6342deb5 100644 (file)
@@ -48,7 +48,8 @@
               :depends-on ("wire-level-tests")
               :components
               ((:file "serialization-tests")
-               (:file "stability-tests")))
+               (:file "stability-tests")
+               (:file "symbol-import-tests")))
 
      ;; Geodata hack
      (:module "geodata-proto"
diff --git a/tests/symbol-import-tests.lisp b/tests/symbol-import-tests.lisp
new file mode 100644 (file)
index 0000000..0de0228
--- /dev/null
@@ -0,0 +1,28 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;                                                                  ;;;
+;;; 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")
+
+;;; Make sure we can import a schema by symbol name in a pure-lisp
+;;; protobuf defintion.
+
+(eval-when (:compile-toplevel :load-toplevel :execute)
+
+  (proto:define-schema symbol-imported-schema
+      (:package proto_test)
+    (proto:define-message symbol-imported-message ()))
+
+)       ;eval-when
+
+(proto:define-schema symbol-importer-schema
+    (:package proto_test
+     :import symbol-imported-schema)
+  (proto:define-message symbol-importer-message ()
+    (imported-type-field :type (or null symbol-imported-message))))