[libattean-perl] 01/42: Fixed as_string serialization of CONSTRUCT algebras (#97).

Jonas Smedegaard dr at jones.dk
Mon Feb 12 13:16:12 UTC 2018


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.019-1
in repository libattean-perl.

commit e2d5aa7520003a760d15ad42261dd4a9d7018997
Author: Gregory Todd Williams <greg at evilfunhouse.com>
Date:   Fri Jun 10 21:13:34 2016 -0700

    Fixed as_string serialization of CONSTRUCT algebras (#97).
---
 lib/Attean/Algebra.pm | 6 +++++-
 t/algebra.t           | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/Attean/Algebra.pm b/lib/Attean/Algebra.pm
index 3196ec9..f227d51 100644
--- a/lib/Attean/Algebra.pm
+++ b/lib/Attean/Algebra.pm
@@ -1229,7 +1229,11 @@ package Attean::Algebra::Construct 0.017 {
 
 	sub in_scope_variables { return qw(subject predicate object); }
 	sub tree_attributes { return; }
-	sub algebra_as_string { return 'Construct' }
+	sub algebra_as_string {
+		my $self	= shift;
+		my $triples	= $self->triples;
+		return sprintf('Construct { %s }', join(' . ', map { $_->as_string } @$triples));
+	}
 }
 
 =item * L<Attean::Algebra::Describe>
diff --git a/t/algebra.t b/t/algebra.t
index 4833cb4..47e0848 100644
--- a/t/algebra.t
+++ b/t/algebra.t
@@ -258,10 +258,10 @@ subtest 'Query Serialization' => sub {
 	}
 
 	{
-		local($TODO)	= 'Fix as_string serialization of CONSTRUCT algebras (#97)';
 		my $a	= Attean->get_parser('SPARQL')->parse('CONSTRUCT { ?s ?p 1 } WHERE { ?s ?p 2 }');
 		like($a->as_string, qr/Query.*Construct.*BGP/s);
-		like($a->as_string, qr/Triple/s);
+		like($a->as_string, qr/1/s);
+		like($a->as_string, qr/2/s);
 	}
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libattean-perl.git



More information about the Pkg-perl-cvs-commits mailing list