Skip to content
Snippets Groups Projects
Select Git revision
  • eff26b57eec0c89515bd6fd9fa4631c3da5dccbe
  • master default
  • disable-new-requests
  • fix-bulletin-view-missing-notes-error
  • add-missing-queue-managers
  • projects-task-53
  • projects-task-51
  • projects-task-43
  • projects-task-24
  • projects-task-31
  • projects-task-32
  • projects-task-8
  • project-setup-docs
  • projects-task-28
  • projects-task-27
  • projects-task-9
  • projects-task-7
  • mass-update-course-codes-in-sections
  • wdn-four
  • learning-outcomes
  • additional-bulletin-pages
  • svn-redesign
  • svn-popups
  • svn-trunk
  • svn-performance
  • svn-tim
26 results

RequestController.php

Blame
  • texMath.test.js 7.55 KiB
    import { parallelMapReduce } from './mapReduce.js';
    
    describe('map-reduce with the TeX math monoid', () => {
      test('validates the empty string with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '', 1);
        expect(result.valid).toBe(true);
      });
      test('validates no math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', 'xyz', 1);
        expect(result.valid).toBe(true);
      });
      test('validates inline math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z', 1);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken inline math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z$', 1);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive inline math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$', 1);
        expect(result.valid).toBe(true);
      });
      test('validates display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z', 1);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z$$', 1);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$$y$$', 1);
        expect(result.valid).toBe(true);
      });
      test('validates inline math followed by display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$$y$$', 1);
        expect(result.valid).toBe(true);
      });
      test('validates display math followed by inline math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$y$', 1);
        expect(result.valid).toBe(true);
      });
      test('does not validate a lone dollar sign ending display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$', 1);
        expect(result.valid).toBe(false);
      });
      test('does not validate a lone dollar sign inside display math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$y$$', 1);
        expect(result.valid).toBe(false);
      });
      test('does not validate a double dollar sign ending inline math with one thread', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$$', 1);
        expect(result.valid).toBe(false);
      });
      test('validates the empty string with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '', 2);
        expect(result.valid).toBe(true);
      });
      test('validates no math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'xyz', 2);
        expect(result.valid).toBe(true);
      });
      test('validates inline math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z', 2);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken inline math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z$', 2);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive inline math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$', 2);
        expect(result.valid).toBe(true);
      });
      test('validates display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z', 2);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z$$', 2);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$$y$$', 2);
        expect(result.valid).toBe(true);
      });
      test('validates inline math followed by display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$$y$$', 2);
        expect(result.valid).toBe(true);
      });
      test('validates display math followed by inline math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$y$', 2);
        expect(result.valid).toBe(true);
      });
      test('does not validate a lone dollar sign ending display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$', 2);
        expect(result.valid).toBe(false);
      });
      test('does not validate a lone dollar sign inside display math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$y$$', 2);
        expect(result.valid).toBe(false);
      });
      test('does not validate a double dollar sign ending inline math with two threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$$', 2);
        expect(result.valid).toBe(false);
      });
      test('validates the empty string with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '', 3);
        expect(result.valid).toBe(true);
      });
      test('validates no math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'xyz', 3);
        expect(result.valid).toBe(true);
      });
      test('validates inline math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z', 3);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken inline math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$y$z$', 3);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive inline math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$', 3);
        expect(result.valid).toBe(true);
      });
      test('validates display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z', 3);
        expect(result.valid).toBe(true);
      });
      test('does not validate broken display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', 'x$$y$$z$$', 3);
        expect(result.valid).toBe(false);
      });
      test('validates consecutive display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$$y$$', 3);
        expect(result.valid).toBe(true);
      });
      test('validates inline math followed by display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$$y$$', 3);
        expect(result.valid).toBe(true);
      });
      test('validates display math followed by inline math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$$$y$', 3);
        expect(result.valid).toBe(true);
      });
      test('does not validate a lone dollar sign ending display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$', 3);
        expect(result.valid).toBe(false);
      });
      test('does not validate a lone dollar sign inside display math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$$x$y$$', 3);
        expect(result.valid).toBe(false);
      });
      test('does not validate a double dollar sign ending inline math with three threads', async() => {
        const result = await parallelMapReduce('./texMath.js', '$x$$y$$', 3);
        expect(result.valid).toBe(false);
      });
    });