Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

String cutoff error, prevents passing test

オープン
#196 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, node.js
領域
testing

調査の方向性

tests/tests.js の testWhile を読み、報告されたテストを実行して失敗を再現します。2つの deparse 呼び出しを、示されている期待値と実際の文字列と比較します。完了とは、原因を特定し、テストが成功する集中的な修正を確認することです。

索引モデルが issue の本文から書いたものです。

説明

I apologize if this a quite obvious mistake on my part, but I have been staring at this for an hour. I don't know how this could possibly be a bug on your end, but it's worth a try.

The following test does not pass:

exports.testWhile = function(test){
   test.expect(1);

   var input = parseSingleStat("while(foo() < 1){bar();}");
   var output = parse("var __t0 = foo(); while(__t0 < 1){bar(); var __t0 = foo(); }");

   test.equal(deparse(output), deparse(tacifyFunctions.tacifyWhile(input)));

   test.done();

 }

The following test passes:

exports.testWhile = function(test){
   test.expect(1);

   var input = parseSingleStat("while(foo() < 1){bar();}");
   var output = parse("var __t0 = foo(); while(__t0 < 1){bar(); var __t0 = foo(); }");
   var e = deparse(output);
   var o = deparse(tacifyFunctions.tacifyWhile(input));

   test.equal(e, o);

   test.done();

 }

deparse returns a string. In the former case deparse(tacifyFunctions.tacifyWhile(input)) is returning a string

Here is output from the test

tests
✔ testNested
✖ testWhile

AssertionError: 'var __t0 = foo();\n\nwhile (__t0 < 1) {\n bar();\n var __t0 = foo();\n}' == 'while (__t0 < 1) {\n bar();\n var __t0 = foo();\n}'
at Object.assertWrapper as equal
at Object.exports.testWhile (/home/satshabad/CS/CS585/jaspect/tests/tests.js:53:8)
at Object.wrapTest (/usr/lib/node_modules/nodeunit/lib/core.js:235:16)
at wrapTest (/usr/lib/node_modules/nodeunit/lib/core.js:235:16)
at Object.exports.runTest (/usr/lib/node_modules/nodeunit/lib/core.js:69:9)
at exports.runSuite (/usr/lib/node_modules/nodeunit/lib/core.js:117:25)
at _concat (/usr/lib/node_modules/nodeunit/deps/async.js:508:13)
at async.forEachSeries.iterate (/usr/lib/node_modules/nodeunit/deps/async.js:118:13)
at async.forEachSeries.iterate (/usr/lib/node_modules/nodeunit/deps/async.js:129:25)
at _concat (/usr/lib/node_modules/nodeunit/deps/async.js:510:17)

FAILURES: 1/5 assertions failed (38ms)

I would appreciate any insight.

主要言語
JavaScript
スター
1.9k
フォーク
359
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

caolan/nodeunit のほかの issue

caolan/nodeunit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。