diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-02-22 10:02:15 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-02-22 12:59:38 -0800 |
commit | 343338e95565c2a3e2b1e8fbc4fce325ca0ea2f8 (patch) | |
tree | 4db0b36d217858d84fa24735079f2e02fd802900 /meta-python/recipes-devtools/python | |
parent | 1e853f5c5f8db616baac7dd17634cf4807a70e7d (diff) | |
download | meta-openembedded-343338e95565c2a3e2b1e8fbc4fce325ca0ea2f8.tar.gz |
python3-jsmin: Fix ptests to run with python 3.12+
Remove it from problematic tests list ot fast list as it runs ok now.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
3 files changed, 84 insertions, 2 deletions
diff --git a/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch b/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch new file mode 100644 index 0000000000..2646e2f5a0 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-jsmin/7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From 7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819 Mon Sep 17 00:00:00 2001 | ||
2 | From: aekoroglu <ali.erdinc.koroglu@intel.com> | ||
3 | Date: Fri, 24 Jun 2022 14:12:59 +0300 | ||
4 | Subject: [PATCH] DeprecationWarning invalid escape sequence fix | ||
5 | |||
6 | Upstream-Status: Submitted [https://github.com/tikitu/jsmin/pull/38] | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- | ||
9 | jsmin/test.py | 22 +++++++++++----------- | ||
10 | 1 file changed, 11 insertions(+), 11 deletions(-) | ||
11 | |||
12 | diff --git a/jsmin/test.py b/jsmin/test.py | ||
13 | index 173ac65..afea4e7 100644 | ||
14 | --- a/jsmin/test.py | ||
15 | +++ b/jsmin/test.py | ||
16 | @@ -337,8 +337,8 @@ def testImplicitSemicolon3(self): | ||
17 | self.assertMinified("return//comment...\r\na", "return\na") | ||
18 | |||
19 | def testSingleComment2(self): | ||
20 | - self.assertMinified('x.replace(/\//, "_")// slash to underscore', | ||
21 | - 'x.replace(/\//,"_")') | ||
22 | + self.assertMinified('x.replace(/\\//, "_")// slash to underscore', | ||
23 | + 'x.replace(/\\//,"_")') | ||
24 | |||
25 | def testSlashesNearComments(self): | ||
26 | original = ''' | ||
27 | @@ -383,8 +383,8 @@ def test_space_in_regex(self): | ||
28 | self.assertMinified(original, original) | ||
29 | |||
30 | def test_brackets_around_slashed_regex(self): | ||
31 | - original = 'function a() { /\//.test("a") }' | ||
32 | - expected = 'function a(){/\//.test("a")}' | ||
33 | + original = 'function a() { /\\//.test("a") }' | ||
34 | + expected = 'function a(){/\\//.test("a")}' | ||
35 | self.assertMinified(original, expected) | ||
36 | |||
37 | def test_angular_1(self): | ||
38 | @@ -455,12 +455,12 @@ def testBackticksTagged(self): | ||
39 | def test_issue_bitbucket_16(self): | ||
40 | original = """ | ||
41 | f = function() { | ||
42 | - return /DataTree\/(.*)\//.exec(this._url)[1]; | ||
43 | + return /DataTree\\/(.*)\\//.exec(this._url)[1]; | ||
44 | } | ||
45 | """ | ||
46 | self.assertMinified( | ||
47 | original, | ||
48 | - 'f=function(){return /DataTree\/(.*)\//.exec(this._url)[1];}') | ||
49 | + 'f=function(){return /DataTree\\/(.*)\\//.exec(this._url)[1];}') | ||
50 | |||
51 | def test_issue_bitbucket_17(self): | ||
52 | original = "// hi\n/^(get|post|head|put)$/i.test('POST')" | ||
53 | @@ -470,7 +470,7 @@ def test_issue_bitbucket_17(self): | ||
54 | def test_issue_6(self): | ||
55 | original = ''' | ||
56 | respond.regex = { | ||
57 | - comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi, | ||
58 | + comments: /\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//gi, | ||
59 | urls: 'whatever' | ||
60 | }; | ||
61 | ''' | ||
62 | @@ -548,16 +548,16 @@ def test_issue_9_multi_comments(self): | ||
63 | |||
64 | def test_issue_12_re_nl_if(self): | ||
65 | original = ''' | ||
66 | - var re = /\d{4}/ | ||
67 | + var re = /\\d{4}/ | ||
68 | if (1) { console.log(2); }''' | ||
69 | self.assertMinified( | ||
70 | - original, 'var re=/\d{4}/\nif(1){console.log(2);}') | ||
71 | + original, 'var re=/\\d{4}/\nif(1){console.log(2);}') | ||
72 | |||
73 | def test_issue_12_re_nl_other(self): | ||
74 | original = ''' | ||
75 | - var re = /\d{4}/ | ||
76 | + var re = /\\d{4}/ | ||
77 | g = 10''' | ||
78 | - self.assertMinified(original , 'var re=/\d{4}/\ng=10') | ||
79 | + self.assertMinified(original , 'var re=/\\d{4}/\ng=10') | ||
80 | |||
81 | def test_preserve_copyright(self): | ||
82 | original = ''' | ||
diff --git a/meta-python/recipes-devtools/python/python3-jsmin/run-ptest b/meta-python/recipes-devtools/python/python3-jsmin/run-ptest index cbcfffda5b..586608d7b2 100644 --- a/meta-python/recipes-devtools/python/python3-jsmin/run-ptest +++ b/meta-python/recipes-devtools/python/python3-jsmin/run-ptest | |||
@@ -1,3 +1,2 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | pytest -vv test.py | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' | |
3 | python3 test.py | ||
diff --git a/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb b/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb index 15c9b14595..c3129e7b53 100644 --- a/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb +++ b/meta-python/recipes-devtools/python/python3-jsmin_3.0.1.bb | |||
@@ -10,6 +10,7 @@ SRC_URI[sha256sum] = "c0959a121ef94542e807a674142606f7e90214a2b3d1eb17300244bbb5 | |||
10 | BBCLASSEXTEND = "native nativesdk" | 10 | BBCLASSEXTEND = "native nativesdk" |
11 | 11 | ||
12 | SRC_URI += " \ | 12 | SRC_URI += " \ |
13 | file://7a75d76c2d6bfb917f30ced8f5c0a9a4157f7819.patch \ | ||
13 | file://run-ptest \ | 14 | file://run-ptest \ |
14 | " | 15 | " |
15 | 16 | ||