Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 629eb68

Browse files
committed
Make tests work with yaml-test-suite changes
1 parent 1c12840 commit 629eb68

4 files changed

Lines changed: 29 additions & 11 deletions

File tree

.common.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
SHELL := bash
22

3+
.PHONY: test
4+
35
ifeq ($(ROOT),)
46
$(error ROOT not defined)
57
endif
@@ -60,7 +62,9 @@ $(SPEC_YAML):
6062
make -C $@ src/node_modules
6163

6264
../test/suite:
63-
git clone https://github.com/yaml/yaml-test-suite $@
65+
git clone --branch=main https://github.com/yaml/yaml-test-suite $@
66+
make -C $@ testml
67+
ln -s testml $@/test
6468

6569
$(NODE_MODULES):
6670
make -C $(ROOT) $(@:$(ROOT)/%=%)

coffeescript/test/testml-bridge.coffee

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ class TestMLBridge extends TestML.Bridge
2525
parser.receiver.output()
2626

2727
unescape: (text)->
28-
text.replace(/<SPC>/g, ' ')
29-
.replace(/<TAB>/g, "\t")
28+
text = text
29+
.replace(//g, ' ')
30+
.replace(/*»/g, "\t")
31+
.replace(//g, "\uFEFF")
32+
.replace(//g, '')
33+
.replace(/\n$/, '')
34+
35+
# text = text.replace(/↓/g, "\r")
36+
37+
return text
3038

3139
fix_test_output: (text)->
3240
return text
33-
.replace(/^\+MAP\ \{\}/gm, '+MAP')
34-
.replace(/^\+SEQ\ \[\]/gm, '+SEQ')

javascript/test/testml-bridge.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

perl/test/TestMLBridge.pm

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use v5.12;
22
package TestMLBridge;
33
use base 'TestML::Bridge';
4+
use utf8;
45

56
use lib 'lib';
67

@@ -27,15 +28,20 @@ sub parse {
2728

2829
sub unescape {
2930
my ($self, $text) = @_;
30-
$text =~ s/<SPC>/ /g;
31-
$text =~ s/<TAB>/\t/g;
31+
32+
$text =~ s// /g;
33+
$text =~ s/—*»/\t/g;
34+
$text =~ s//x{FEFF}/g;
35+
$text =~ s///g;
36+
$text =~ s/\n\z//;
37+
38+
# $text =~ s/↓/\r/g;
39+
3240
return $text;
3341
}
3442

3543
sub fix_test_output {
3644
my ($self, $text) = @_;
37-
$text =~ s/^\+MAP\ \{\}/+MAP/gm;
38-
$text =~ s/^\+SEQ\ \[\]/+SEQ/gm;
3945
return $text;
4046
}
4147

0 commit comments

Comments
 (0)