Skip to content
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

Format specifiers galore #20

Merged
merged 26 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a70201b
Support .NET-style format specifiers and alignments
jwosty Jun 26, 2023
f82a634
Implement %x translation
jwosty Jun 26, 2023
b22eac3
Translate width and precision specifiers
jwosty Jun 26, 2023
34ff4ff
Assert rendered output using Serilog TextWriter sink
jwosty Jun 27, 2023
e6c583c
Fix remaining test cases (and corresponding code when necessary)
jwosty Jun 28, 2023
4a68f5b
Optimize with stringbuilder
jwosty Jun 28, 2023
397cd3e
Fix JS tests
jwosty Jun 28, 2023
957070c
Change tests to assert against equivalent sprintf calls as well
jwosty Jul 3, 2023
766f2bc
Fix width to pad with spaces, not leading zeros as per MS docs
jwosty Jul 3, 2023
0bd2ea0
Implement zero-padding
jwosty Jul 3, 2023
d24d976
Replace sharedTestCase with theory
jwosty Jul 3, 2023
d31f10f
Parameterize test sets on log level, too
jwosty Jul 3, 2023
be66363
Compare log parameters instead of equivalent log call
jwosty Jul 3, 2023
8f83e83
Merge together now identical functions
jwosty Jul 3, 2023
f2da5a4
Make Fable logf capable of stripping parameters with custom formatting
jwosty Jul 3, 2023
1302990
Make .net-style formatters work under Fable
jwosty Jul 3, 2023
022805f
Refactor
jwosty Jul 3, 2023
6d02818
Implement %e and %E
jwosty Jul 4, 2023
b33de4b
Fix some corner cases around negative zeros and numbers close to it
jwosty Jul 5, 2023
33ea64f
Implement left-justify (-) flag
jwosty Jul 6, 2023
05de2b9
Implement space flag
jwosty Jul 6, 2023
3f647ef
Fix corner cases when combining + flag or space flag with 0 flag
jwosty Jul 6, 2023
7cddfc3
Treat `-0` flags as `-`
jwosty Jul 6, 2023
6f1397c
Refactor
jwosty Jul 6, 2023
3a86d5c
Fix some more missing corner cases
jwosty Jul 6, 2023
efd05d2
Make fable tests pass by disabling workaround expectation value for f…
jwosty Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ bower_components
packages/
# autogenerated by build.fsproj
paket.template
.paket/load/

### Fable ###
*.fs.js
Expand Down
7 changes: 5 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ framework: auto-detect

nuget BlackFox.MasterOfFoo 1.0
nuget Expecto 8.1.0
nuget Fable.Core 3.0
nuget Fable.Core 4.0
nuget Fable.Mocha
nuget FSharp.Core = 4.6.2
nuget Microsoft.Extensions.Logging 6.0.0
Expand Down Expand Up @@ -33,10 +33,13 @@ group Test

nuget BlackFox.MasterOfFoo >= 1.0
nuget Expecto >= 8.1.0
nuget Fable.Core >= 3.0
nuget Fable.Browser.Dom
nuget Fable.Core >= 4.0
nuget Fable.Mocha
nuget Microsoft.Extensions.Logging >= 6.0.0
nuget Microsoft.NET.Test.Sdk
nuget Serilog.Extensions.Logging
nuget Serilog.Sinks.TextWriter
nuget Suave >= 2.5.0
nuget YoloDev.Expecto.TestSdk
nuget FSharp.Core >= 6.0.0
Expand Down
51 changes: 48 additions & 3 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ NUGET
Argu (>= 5.1)
Mono.Cecil (>= 0.10)
System.Diagnostics.FileVersionInfo (>= 4.3)
Fable.Core (3.0)
FSharp.Core (>= 4.5.2)
Fable.Core (4.0)
Fable.Mocha (2.6)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.6.2)
Expand Down Expand Up @@ -702,7 +701,27 @@ NUGET
Expecto (9.0.4)
FSharp.Core (>= 4.6)
Mono.Cecil (>= 0.11.3)
Fable.Core (3.7.1)
Fable.Browser.Blob (1.3)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.Dom (2.14)
Fable.Browser.Blob (>= 1.3)
Fable.Browser.Event (>= 1.5)
Fable.Browser.WebStorage (>= 1.2)
Fable.Core (>= 3.2.8)
FSharp.Core (>= 4.7.2)
Fable.Browser.Event (1.5)
Fable.Browser.Gamepad (>= 1.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.Gamepad (1.2)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.WebStorage (1.2)
Fable.Browser.Event (>= 1.5)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Core (4.0)
Fable.Mocha (2.15)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7)
Expand All @@ -725,6 +744,8 @@ NUGET
Microsoft.NET.Test.Sdk (17.4.1)
Microsoft.CodeCoverage (>= 17.4.1)
Microsoft.TestPlatform.TestHost (>= 17.4.1)
Microsoft.NETCore.Platforms (7.0.3)
Microsoft.NETCore.Targets (5.0)
Microsoft.TestPlatform.ObjectModel (17.4.1)
NuGet.Frameworks (>= 5.11)
System.Reflection.Metadata (>= 1.6)
Expand All @@ -734,13 +755,37 @@ NUGET
Mono.Cecil (0.11.4)
Newtonsoft.Json (13.0.2)
NuGet.Frameworks (6.4)
Serilog (3.0.1)
Serilog.Extensions.Logging (7.0)
Microsoft.Extensions.Logging (>= 7.0)
Serilog (>= 2.12)
Serilog.Sinks.TextWriter (2.1)
Serilog (>= 2.0)
System.IO (>= 4.1)
Suave (2.6.2)
FSharp.Core
System.Collections.Immutable (7.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.IO (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Reflection.Metadata (7.0)
System.Collections.Immutable (>= 7.0)
System.Runtime (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime.CompilerServices.Unsafe (6.0)
System.Text.Encoding (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Threading.Tasks (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
YoloDev.Expecto.TestSdk (0.13.3)
Expecto (>= 9.0 < 10.0)
FSharp.Core (>= 4.6.2)
Expand Down
Loading