@@ -131,6 +131,45 @@ describe('Util', () => {
131131 } ) ;
132132 } ) ;
133133
134+ describe ( 'isQuad' , ( ) => {
135+ it ( 'matches a quad' , ( ) => {
136+ expect ( Util . isQuad ( quad ( null , null , null , null ) ) ) . toBe ( true ) ;
137+ } ) ;
138+
139+ it ( 'matches a quad with iri content' , ( ) => {
140+ expect ( Util . isQuad ( quad (
141+ namedNode ( 'http://example.org/' ) ,
142+ namedNode ( 'http://example.org/' ) ,
143+ namedNode ( 'http://example.org/' ) ,
144+ namedNode ( 'http://example.org/' ) ,
145+ ) ) ) . toBe ( true ) ;
146+ } ) ;
147+
148+ it ( 'does not match an IRI' , ( ) => {
149+ expect ( Util . isQuad ( namedNode ( 'http://example.org/' ) ) ) . toBe ( false ) ;
150+ } ) ;
151+
152+ it ( 'does not match a literal' , ( ) => {
153+ expect ( Util . isQuad ( literal ( 'http://example.org/' ) ) ) . toBe ( false ) ;
154+ } ) ;
155+
156+ it ( 'does not match a blank node' , ( ) => {
157+ expect ( Util . isQuad ( blankNode ( 'x' ) ) ) . toBe ( false ) ;
158+ } ) ;
159+
160+ it ( 'does not match a variable' , ( ) => {
161+ expect ( Util . isQuad ( variable ( 'x' ) ) ) . toBe ( false ) ;
162+ } ) ;
163+
164+ it ( 'does not match null' , ( ) => {
165+ expect ( Util . isQuad ( null ) ) . toBe ( false ) ;
166+ } ) ;
167+
168+ it ( 'does not match undefined' , ( ) => {
169+ expect ( Util . isQuad ( undefined ) ) . toBe ( false ) ;
170+ } ) ;
171+ } ) ;
172+
134173 describe ( 'isDefaultGraph' , ( ) => {
135174 it ( 'does not match a blank node' , ( ) => {
136175 expect ( Util . isDefaultGraph ( blankNode ( 'x' ) ) ) . toBe ( false ) ;
0 commit comments