Skip to content

reactivate test - Help is displayed correctly #13792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 30, 2022

Conversation

KevinRansom
Copy link
Contributor

This testcase fell into the black hole that is outputwidth buffers.

For the longest time the most annoying tests we have are the fsharpqa tests that verify --help behavior. This test case was an attempt to improve on that.

However, it turns out that help text is always displayed as 80 on platforms that don't really support Console.BufferWidth (Linux and MacOS seem to return 0).

Windows is even more exciting, because it supports bufferwidth and we use it to format help text, when running tests on windows, success of this test depended on having the buffer size of the console running tests less than 80 chars wide.

Anyway ... enough of our problems. With this PR, we have added a testmode command line switch to the fsc and fsi that when specified sets the helptext formatting to the use the width value supplied in the option.

I also changed the printf of blockheaders - OUTPUT FILES - to use spaces rather than tabs, because updating baselines is easier.
use fsc.exe --bufferwidth:80 --nowarn:75 --help to eliminate the warning message

c:\kevinransom\fsharp>artifacts\bin\fsi\Release\net472\fsi.exe --bufferwidth:1200 --help


warning FS0075: The command-line option '--bufferWidth' is for test purposes only

Microsoft (R) F# Interactive version 12.0.5.0 for F# 7.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

Usage: fsi <options> [script.fsx [<arguments>]]


                - INPUT FILES -
--use:<file>                             Use the given file on startup as initial input
--load:<file>                            #load the given file on startup
--reference:<file>                       Reference an assembly (Short form: -r)
-

@KevinRansom KevinRansom merged commit 9a29bed into dotnet:main Aug 30, 2022
KevinRansom added a commit that referenced this pull request Aug 30, 2022
* Revert tools.sh edit (#13796)

* Revert tools.sh edit

* Add binlog to build.sh for proto stuff

* Verify ship status (#13793)

* Verify ship status

* -verifypackageshipstatus in the right place

* more

* Update Versions.props

* Update azure-pipelines.yml

* reactivate test - Help is displayed correctly (#13792)

* tcconfig/tcconfigbuilder

* add --bufferwidth

* fantomas

* oops

Co-authored-by: Vlad Zarytovskii <[email protected]>

Co-authored-by: Kevin Ransom (msft) <[email protected]>
Co-authored-by: Vlad Zarytovskii <[email protected]>
@psfinaki
Copy link
Member

psfinaki commented Sep 7, 2022

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants