Skip to content

Commit

Permalink
Test with record indexed in RdfStore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed May 5, 2023
1 parent 8754949 commit 43da728
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/RdfStore-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import each from 'jest-each';
import { DataFactory } from 'rdf-data-factory';
import type { QuadTermName } from 'rdf-terms';
import type { DatasetCoreWrapper } from '../lib/dataset/DatasetCoreWrapper';
import { TermDictionaryNumberMap } from '../lib/dictionary/TermDictionaryNumberMap';
import { RdfStoreIndexNestedMap } from '../lib/index/RdfStoreIndexNestedMap';
import { TermDictionaryNumberRecordFullTerms } from '../lib/dictionary/TermDictionaryNumberRecordFullTerms';
import { RdfStoreIndexNestedRecord } from '../lib/index/RdfStoreIndexNestedRecord';
import { RdfStore } from '../lib/RdfStore';
import 'jest-rdf';

Expand Down Expand Up @@ -50,8 +50,8 @@ describe('RdfStore', () => {
beforeEach(() => {
store = new RdfStore<number>({
indexCombinations,
indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions),
dictionary: new TermDictionaryNumberMap(),
indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions),
dictionary: new TermDictionaryNumberRecordFullTerms(),
dataFactory: new DataFactory(),
});
});
Expand Down Expand Up @@ -1059,17 +1059,17 @@ describe('RdfStore', () => {
it('not no combinations', () => {
expect(() => new RdfStore<number>({
indexCombinations: [],
indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions),
dictionary: new TermDictionaryNumberMap(),
indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions),
dictionary: new TermDictionaryNumberRecordFullTerms(),
dataFactory: new DataFactory(),
})).toThrow(`At least one index combination is required`);
});

it('not not enough components', () => {
expect(() => new RdfStore<number>({
indexCombinations: [[ 'subject', 'predicate' ]],
indexConstructor: subOptions => new RdfStoreIndexNestedMap(subOptions),
dictionary: new TermDictionaryNumberMap(),
indexConstructor: subOptions => new RdfStoreIndexNestedRecord(subOptions),
dictionary: new TermDictionaryNumberRecordFullTerms(),
dataFactory: new DataFactory(),
})).toThrow(`Invalid index combination: subject,predicate`);
});
Expand Down

0 comments on commit 43da728

Please sign in to comment.