Skip to content

Commit

Permalink
for by char test problem
Browse files Browse the repository at this point in the history
  • Loading branch information
vedro-compota committed Aug 8, 2021
1 parent 91945d2 commit 422717e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/__tests__/loops/for/for_by_char/for_base.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var a, b, d, e, c: char;
begin
for c := 'A' to 'B' do
begin
a := c;
end;

(* for c := 'a' to 'E' do
begin
b := c;
end;
for c := 'E' to 'g' do
begin
d := c;
end;
for c := 'Z' downto 'A' do
begin
e := c;
end; *)
end.
20 changes: 20 additions & 0 deletions tests/__tests__/loops/for/for_by_char/for_by_char.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

import { runFile, insp } from '../../../../testsHelper';

let pjs = runFile(import.meta.url, 'for_base.pas');

test(`for loop by char "for c := 'A' to 'Z'" `, () => {
expect(pjs.getVarValue('a')).toBe('Z');
});
// test(`for loop by char "for c := 'a' to 'E'"`, () => {
// expect(pjs.getVarValue('b')).toBe('E');
// });
// test(`for loop by char "for c := 'E' to 'g'"`, () => {
// expect(pjs.getVarValue('d')).toBe('g');
// });
// test(`for loop by char "for c := 'Z' downto 'A' do"`, () => {
// expect(pjs.getVarValue('e')).toBe('A');
// });



Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import { runFile, insp } from '../../../../testsHelper';

let pjs = runFile(import.meta.url, 'char_assignation_base.pas');

test(`char assignation base `, () => {
expect(pjs.getVarValue('a')).toBe('A');
});




Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var a: char;
begin
a := 'A'
end.

0 comments on commit 422717e

Please sign in to comment.