Snippets in category Testing and Debugging
Conditional printf
Disable printf based on some condition
26 people like this
Posted: 1 years ago by LaurentNUnit Sugar
Some simple functions for writing more idiomatic F# tests with NUnit.
45 people like this
Posted: 1 years ago by Ryan RileyParallel Sitemap Test Runner
A sitemap-based url tester that runs in parallel.
35 people like this
Posted: 1 years ago by Ryan RileyFSX Structure
I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.
66 people like this
Posted: 1 years ago by Blake Coverettdebugging window
The window is useful when you want to print out data to the screen.
9 people like this
Posted: 1 years ago by Stefan KnoblauchInspect middle of a pipeline in VS 2010 debugger
Put the code at some place and enable "Step Into Properties and Operators in Managed Code": http://msdn.microsoft.com/en-us/library/cc667388.aspx Now you should be able to step into the pipeline operator.
32 people like this
Posted: 1 years ago by Oldrich Svecexec with redirected io as sequences
Since F# is my new scripting language, I needed something like Perl's exec but with sequences for Std In and Out.
5 people like this
Posted: 1 years ago by Tony Lee"use"able temporary file
A simple shortcut for creating temporary files for unit tests.
2 people like this
Posted: 1 years ago by Benjol
Alternative Conditional Printfn
A different approach to conditional debug functions
1 people like this
Posted: 11 months ago by David KleinCreating Visual Studio Macros in F#
this snippet presents a way to create macros in F# to automato VS IDE environment. To compile, just open a Command prompt window and type: fsc --out:fsmacros.dll --reference:envdte.dll --target:library fsmacros.fs Where FSMACROS.FS is the file name I gave for the code. After compile, copy the dll to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies To use, just open F# interactive in Visual Studio (CTRL+ALT+F) and type: #r “envdte”;; #r “fsmacros”;; Let dte = vs10macros.getDte “The main window title appearing in you VS 2010”;;
1 people like this
Posted: 10 months ago by Eduardo ClaudioSHA256
Calculates sha256 of the files passed in on the command line. Usage: fsi sha256.fsx downloadedFile.zip
1 people like this
Posted: 7 months ago by Tony LeeConvert the number of indentation spaces in a sourcecode.
This small script converts continuous 4 spaces to 2 spaces by using Regex. It gets the source code from a clip board text and save it to clip board. Since this program doesn't parse the source code, conversion is not perfect. But writing script which interacts with clipboard is so easy, you can automate your trivial coding work with a small effort. Using F#interactive with Clipboard is my favorite way of meta-programming.
1 people like this
Posted: 6 months ago by nagat01Loading .fs files
This script facilitates to load all the .fs files in the specified F# project in correct compilation order.
3 people like this
Posted: 4 months ago by nagat01unit test in VS11 beta
Demo F# unit test in VS11 beta. In VS 2010 unit testing requires a hack whereby you add a c# test project to your solution and add to that project a linked item to the DLL of the F# project with the test methods.
6 people like this
Posted: 2 months ago by Jack FoxMbUnit DSL
DSL for functional style, HUnit-like testing with MbUnit.
3 people like this
Posted: 2 months ago by Mauricio Scheffer