zopencommunity / zopencommunity/bashport

new-exp.tests fails with string manipulation

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Groovy
Stars
12
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Running the test 'by hand' it seems to work ok, but running in the harness, it gets truncated.
The particular failing test is in new-exp8.sub:

declare z="start"
declare NUM=1000
pat1='str'
export LINE_MAX=100
#----------------------------------
# create a long string with ';'
#----------------------------------
for ((i=0; i<$NUM; i++)); do
    z="$z;string$i"
done

#z="$z;string;foo"

#------------------------------
# delete everything except ';'
#------------------------------

# try different patterns here
x="${z//$pat1}"
echo $x

The string being echo'ed is getting truncated

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing test in new-exp8.sub and compare its behavior when run by hand with its behavior in the new-exp.tests harness. Trace how the generated long string is passed to the harness and determine why the echoed value is truncated; done means the test completes without truncating the string.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.