{"size": 2883, "ext": "js", "max_stars_repo_path": "test/compiler/data/testConstant.js", "max_stars_repo_name": "ArnoVanDerVegt/MVM", "max_stars_repo_stars_event_min_datetime": "2017-04-21T23:38:28.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-18T06:14:11.000Z", "max_issues_repo_path": "test/compiler/data/testConstant.js", "max_issues_repo_name": "ArnoVanDerVegt/MVM", "max_issues_repo_issues_event_min_datetime": "2020-10-06T18:08:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T18:57:22.000Z", "max_forks_repo_path": "test/compiler/data/testConstant.js", "max_forks_repo_name": "ArnoVanDerVegt/wheel", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 14, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 30.3473684211, "max_line_length": 87, "alphanum_fraction": 0.2188692334}
/**
 * Wheel, copyright (c) 2017 - present by Arno van der Vegt
 * Distributed under an MIT license: https://arnovandervegt.github.io/wheel/license.txt
**/
const testLogs = require('../../utils').testLogs;

describe(
    'Test constant',
    () => {
        describe(
            'Test number',
            () => {
                testLogs(
                    it,
                    'Should declare global constant number',
                    [
                        'number a = 29',
                        'proc main()',
                        '    addr a',
                        '    mod 0, 1',
                        'end'
                    ],
                    [
                        29
                    ]
                );
                testLogs(
                    it,
                    'Should declare global constant numbers',
                    [
                        'number a = 45',
                        'number b = 197',
                        'proc main()',
                        '    addr a',
                        '    mod 0, 1',
                        '    addr b',
                        '    mod 0, 1',
                        'end'
                    ],
                    [
                        45, 197
                    ]
                );
                testLogs(
                    it,
                    'Should declare global constant numbers',
                    [
                        'number a = 566, b = 4644',
                        'proc main()',
                        '    addr a',
                        '    mod 0, 1',
                        '    addr b',
                        '    mod 0, 1',
                        'end'
                    ],
                    [
                        566, 4644
                    ]
                );
                testLogs(
                    it,
                    'Should declare local constant number',
                    [
                        'proc main()',
                        '    number a = 991',
                        '    addr a',
                        '    mod 0, 1',
                        'end'
                    ],
                    [
                        991
                    ]
                );
                testLogs(
                    it,
                    'Should declare local constant number',
                    [
                        'proc main()',
                        '    number a = 289',
                        '    number b = 2133',
                        '    addr a',
                        '    mod 0, 1',
                        '    addr b',
                        '    mod 0, 1',
                        'end'
                    ],
                    [
                        289, 2133
                    ]
                );
            }
        );
    }
);
