Move isDict unit-tests from util_spec.js to primitives_spec.js

This patch moves the unit-test to the correct file, since the `isDict` function was moved PR 6683.
This commit is contained in:
Jonas Jenwald 2016-04-16 20:32:46 +02:00
parent 4523ae0b91
commit b4a17323b6
2 changed files with 15 additions and 17 deletions

View File

@ -1,10 +1,9 @@
/* globals expect, it, describe, beforeEach, Name, Dict, Ref, RefSet, Cmd,
jasmine */
jasmine, isDict */
'use strict';
describe('primitives', function() {
describe('Name', function() {
it('should retain the given name', function() {
var givenName = 'Font';
@ -146,4 +145,17 @@ describe('primitives', function() {
expect(refset.has(anotherRef)).toBeFalsy();
});
});
describe('isDict', function() {
it('handles empty dictionaries with type check', function() {
var dict = new Dict();
expect(isDict(dict, 'Page')).toEqual(false);
});
it('handles dictionaries with type check', function() {
var dict = new Dict();
dict.set('Type', Name.get('Page'));
expect(isDict(dict, 'Page')).toEqual(true);
});
});
});

View File

@ -1,22 +1,8 @@
/* globals expect, it, describe, Dict, isDict, Name, PDFJS,
stringToPDFString, removeNullCharacters */
/* globals describe, it, expect, stringToPDFString, removeNullCharacters */
'use strict';
describe('util', function() {
describe('isDict', function() {
it('handles empty dictionaries with type check', function() {
var dict = new Dict();
expect(isDict(dict, 'Page')).toEqual(false);
});
it('handles dictionaries with type check', function() {
var dict = new Dict();
dict.set('Type', Name.get('Page'));
expect(isDict(dict, 'Page')).toEqual(true);
});
});
describe('stringToPDFString', function() {
it('handles ISO Latin 1 strings', function() {
var str = '\x8Dstring\x8E';