File tree Expand file tree Collapse file tree 5 files changed +28
-2
lines changed
Expand file tree Collapse file tree 5 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ more. Some bindings have already been added:
2323Prerequisite for compiling F# to Python using Fable:
2424
2525``` sh
26- > dotnet tool install --global fable-py --version 4.0.0-alpha-004
27- > dotnet add package Fable.Core.Experimental --version 4.0.0-alpha-005
26+ > dotnet tool install --global fable-py --version 4.0.0-alpha-005
27+ > dotnet add package Fable.Core.Experimental --version 4.0.0-alpha-006
2828```
2929
3030To use the ` Fable.Python ` library in your Fable project:
Original file line number Diff line number Diff line change 1+ # https://fsprojects.github.io/Paket/nuget-dependencies.html
12
23source https://api.nuget.org/v3/index.json
34storage: none
Original file line number Diff line number Diff line change 1+ module Fable.Python.String
2+
3+ open System
4+ open Fable.Core
5+
6+ // fsharplint:disable MemberNames
7+
8+ type System.String with
9+ [<Emit( " $0.format($1...)" ) >]
10+ member self.format ( [<ParamArray>] args : Object []) = nativeOnly
Original file line number Diff line number Diff line change 1515 <Compile Include =" TestAst.fs" />
1616 <Compile Include =" TestBuiltins.fs" />
1717 <Compile Include =" TestJson.fs" />
18+ <Compile Include =" TestString.fs" />
1819 <Compile Include =" Main.fs" />
1920 </ItemGroup >
2021 <Import Project =" ..\.paket\Paket.Restore.targets" />
Original file line number Diff line number Diff line change 1+ module Fable.Python.Tests.String
2+
3+ open Util.Testing
4+ open Fable.Python .String
5+
6+ [<Fact>]
7+ let ``test string format works`` () =
8+ let result = " The sum of 1 + 2 is {0}" .format( 1 + 2 )
9+ result |> equal " The sum of 1 + 2 is 3"
10+
11+ [<Fact>]
12+ let ``test string format 2 works`` () =
13+ let result = " The sum of {0} + 2 is {1}" .format( 1 , 1 + 2 )
14+ result |> equal " The sum of 1 + 2 is 3"
You can’t perform that action at this time.
0 commit comments