Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uvu does not like inifinite linked lists #203

Open
Hexagon opened this issue Mar 31, 2022 · 0 comments
Open

uvu does not like inifinite linked lists #203

Hexagon opened this issue Mar 31, 2022 · 0 comments

Comments

@Hexagon
Copy link

Hexagon commented Mar 31, 2022

import { test } from 'uvu';
import * as assert from 'uvu/assert';

test('Circular reference', () => {

    const obj1 = {}, obj2 = {};

    // Very compact infinite linked list
    obj1.next = obj2;
    obj2.next = obj1;

    /*
        PASS
    */
    assert.equal(obj1.next, obj2);

    /*
        FAIL  "Circular reference"
        Maximum call stack size exceeded

        at dequal (file:///.../node_modules/dequal/dist/index.mjs:11:2)
        at dequal (file:///.../node_modules/dequal/dist/index.mjs:77:28)
    */
    assert.not.equal(obj1, obj2);

});

test.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant