Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
Puntos extraños en la salida al imprimir una cadena de varias líneas mientras se ejecuta una prueba npm

Estoy creando una aplicación de lista de tareas pendientes y uno de los comandos en esta aplicación es imprimir la ayuda aquí está mi código:

 @app.command() def help(): y="""""Usage :-\n $ ./task add 2 hello world\t # Add a new item with priority 2 and text \"hello world\" to the list\n $ ./task ls\t # Show incomplete priority list items sorted by priority in ascending order $ ./task del INDEX\t # Delete the incomplete item with the given index\n $ ./task done INDEX\t # Mark the incomplete item with the given index as complete\n $ ./task help\t # Show usage\n $ ./task report\t # Statistics""" print(y)

Cuando ejecuto este código, obtengo el resultado normal que se puede imaginar. Pero cuando ejecuto la prueba de automatización de npm proporcionada por mi pasantía, recibo un resultado diferente.

Aquí están los resultados esperados y recibidos:

 Expected: StringContaining "Usage :- $ ./task add 2 hello world # Add a new item with priority 2 and text \"hello world\" to the list $ ./task ls # Show incomplete priority list items sorted by priority in ascending order $ ./task del INDEX # Delete the incomplete item with the given index $ ./task done INDEX # Mark the incomplete item with the given index as complete $ ./task help # Show usage $ ./task report # Statistics" Received: "Usage :-··· $ ./task add 2 hello world # Add a new item with priority 2 and text \"hello world\" to the list··· $ ./task ls # Show incomplete priority list items sorted by priority in ascending order··· $ ./task del INDEX # Delete the incomplete item with the given index··· $ ./task done INDEX # Mark the incomplete item with the given index as complete··· $ ./task help # Show usage··· $ ./task report # Statistics· "

Como puede ver, obtengo estos puntos extraños en mi salida mientras ejecuto pruebas npm. Cualquier ayuda en esto sería apreciada.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!