<commit_before>var getCoreRunner = require('./../getCoreRunner');
var cacheGenerator = require('./../CacheGenerator');
var toTree = require('falcor-path-utils').toTree;
var jsonGraph = require('falcor-json-graph');
var atom = jsonGraph.atom;
var _ = require('lodash');
var error = jsonGraph.error;
var expect = require('chai').expect;
var jsonGraphDerefException = 'It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.'
var Model = require('./../../lib').Model;

describe('Deref', function() {
    // PathMap ----------------------------------------
    var tests = [{
        it: 'should get a simple value out of the cache',
        input: [['title']],
        output: {
            json: {
                title: 'Video 0'
            }
        },
        deref: ['videos', 0],
        cache: cacheGenerator(0, 1)
    }];
<commit_msg>verified that missing paths and cache is correctly generated with multiple argument caches.<commit_after>var getCoreRunner = require('./../getCoreRunner');
var cacheGenerator = require('./../CacheGenerator');
var toTree = require('falcor-path-utils').toTree;
var jsonGraph = require('falcor-json-graph');
var atom = jsonGraph.atom;
var _ = require('lodash');
var error = jsonGraph.error;
var expect = require('chai').expect;
var jsonGraphDerefException = 'It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.'
var Model = require('./../../lib').Model;

describe('Deref', function() {
    // PathMap ----------------------------------------
    var tests = [{
        it: 'should get a simple value out of the cache',
        input: [['title']],
        output: {
            json: {
                title: 'Video 0'
            }
        },
        deref: ['videos', 0],
        cache: cacheGenerator(0, 1)
    }, {
        it: 'should get multiple arguments out of the cache.',
        input: [
            [0, 'item', 'title'],
            [1, 'item', 'title']
        ],
        output: {
            json: {
                0: {
                    item: {
                        title: 'Video 0'
                    }
                },
                1: {
                    item: {
                        title: 'Video 1'
                    }
                }
            }
        },
        deref: ['lists', 'A'],
        cache: cacheGenerator(0, 2)
    }, {
        it: 'should get multiple arguments as missing paths from the cache.',
        input: [
            ['b', 'c'],
            ['b', 'd']
        ],
        output: { },
        deref: ['a'],
        optimizedMissingPaths: [
            ['a', 'b', 'c'],
            ['a', 'b', 'd']
        ],
        cache: {
            a: {
                b: {
                    e: '&'
                }
            }
        }
    }];

{'fraction_non_alphanumeric': 0.16782729805013927, 'fraction_numerical': 0.005571030640668524, 'mean_word_length': 1.4788610871440897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2732908', 'n_tokens_mistral': 795, 'n_tokens_neox': 758, 'n_words': 238}