Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some more tests, refs #42

  • Loading branch information...
commit afe1090f4f0494d957c86d7eeeadfde719a346e6 1 parent a752954
@bergie authored
Showing with 39 additions and 1 deletion.
  1. +39 −1 test/standard/rdfa11-testharness.js
View
40 test/standard/rdfa11-testharness.js
@@ -1,6 +1,6 @@
// These tests are adapted from
// http://rdfa.digitalbazaar.com/test-suite/
-module("vie.js - RDFa 1.1 parsing tests");
+module("vie.js - RDFa 1.1 Test Suite");
test("Test #1 (required): Predicate establishment with @property", function() {
var z = new VIE();
@@ -59,3 +59,41 @@ test("Test #7 (required): @rel, @rev, @property, @content", function() {
start();
});
});
+
+test("Test #9 (required): @rev", function() {
+ var z = new VIE();
+ z.use(new z.RdfaService);
+
+ var html = jQuery('<link about="http://example.org/people#Person1" rev="foaf:knows" href="http://example.org/people#Person2" />');
+
+ stop(1000); // 1 second timeout
+ z.load({element: html}).from('rdfa').execute().done(function(entities) {
+ ok(entities);
+ equal(entities.length, 1);
+
+ equal(entities[0].id, '<http://example.org/people#Person2>');
+ equal(entities[0].get('foaf:knows'), '<http://example.org/people#Person1>');
+ start();
+ });
+});
+
+test("Test #10 (required): @rel, @rev, @href", function() {
+ var z = new VIE();
+ z.use(new z.RdfaService);
+
+ var html = jQuery('<link about="http://example.org/people#Person1" rel="foaf:knows" rev="foaf:knows" href="http://example.org/people#Person2" />');
+
+ stop(1000); // 1 second timeout
+ z.load({element: html}).from('rdfa').execute().done(function(entities) {
+ ok(entities);
+ equal(entities.length, 2);
+
+ equal(entities[0].id, '<http://example.org/people#Person1>');
+ equal(entities[0].get('foaf:knows'), '<http://example.org/people#Person2>');
+
+ equal(entities[1].id, '<http://example.org/people#Person2>');
+ equal(entities[1].get('foaf:knows'), '<http://example.org/people#Person1>');
+
+ start();
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.