From 7ae58ad746c87d973b2dc5055480179b9f48c7ac Mon Sep 17 00:00:00 2001 From: v_oxyang Date: Sat, 3 Aug 2019 18:43:28 +0800 Subject: [PATCH 1/5] travis ci test --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f52bbce..5f0b956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "6" + - "10" addons: chrome: stable @@ -10,5 +10,8 @@ before_script: - "sh -e /etc/init.d/xvfb start" - sleep 3 # give xvfb some time to start +services: + - xvfb + before_install: npm install karma-cli -g \ No newline at end of file From 9de8d4532435317fdf7e0a2e13198a474ab5748b Mon Sep 17 00:00:00 2001 From: v_oxyang Date: Sat, 3 Aug 2019 18:54:23 +0800 Subject: [PATCH 2/5] travis ci test --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f0b956..38a4c85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,6 @@ node_js: addons: chrome: stable -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 3 # give xvfb some time to start - services: - xvfb From e3a64a48ced6424e50255516c562a7ec6518c2c3 Mon Sep 17 00:00:00 2001 From: "492076932@qq.com" Date: Sat, 3 Aug 2019 21:25:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9D=A8=E9=91=AB=20=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- karma.conf.js | 2 +- quz/quz.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 0747749..432b55e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -70,7 +70,7 @@ module.exports = function(config) { // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits - singleRun: true, + singleRun: false, // Concurrency level // how many browser should be started simultaneous diff --git a/quz/quz.js b/quz/quz.js index 624e7de..77e9945 100755 --- a/quz/quz.js +++ b/quz/quz.js @@ -9,6 +9,12 @@ */ function dcate(A, B) { /** Fill in here **/ + let currList = A + while (currList.tail !== null) { + currList = currList.tail; + } + currList.tail = B; + return A; } /** @@ -24,4 +30,18 @@ function dcate(A, B) { */ function sub(L, start, len) { /** Fill in here **/ + if (!L || !(/(^[0-9]\d*$)/.test(start)) || !(/(^[0-9]\d*$)/.test(len))) throw new Error('param error'); + let newList = [], + subLen = 0, + currList = L, + currIndex = 0 + do { + if (currIndex >= start){ + newList.push(currList.head); + subLen++; + } + currList = currList.tail; + currIndex++; + } while (len !== subLen); + return new List.list(newList); } From 537466f91de4d4c9f0762155b79659e343c05ea5 Mon Sep 17 00:00:00 2001 From: "492076932@qq.com" Date: Sat, 3 Aug 2019 21:39:49 +0800 Subject: [PATCH 4/5] homework --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 432b55e..0747749 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -70,7 +70,7 @@ module.exports = function(config) { // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits - singleRun: false, + singleRun: true, // Concurrency level // how many browser should be started simultaneous From d7c3bdc5a74e2655a97635c7a46ea15a4a8e6a9d Mon Sep 17 00:00:00 2001 From: "492076932@qq.com" Date: Sat, 3 Aug 2019 22:17:22 +0800 Subject: [PATCH 5/5] bugfix --- quz/quz.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quz/quz.js b/quz/quz.js index 77e9945..ac01409 100755 --- a/quz/quz.js +++ b/quz/quz.js @@ -42,6 +42,6 @@ function sub(L, start, len) { } currList = currList.tail; currIndex++; - } while (len !== subLen); + } while (len !== subLen && currList !== null); return new List.list(newList); }