mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
writers: disable broken test (fsharp) (#343507)
This commit is contained in:
commit
a6521dc687
@ -245,30 +245,32 @@ recurseIntoAttrs {
|
||||
# print(y[0]['test'])
|
||||
#'');
|
||||
|
||||
fsharp = expectSuccess (makeFSharpWriter {
|
||||
libraries = { fetchNuGet }: [
|
||||
(fetchNuGet { pname = "FSharp.SystemTextJson"; version = "0.17.4"; sha256 = "1bplzc9ybdqspii4q28l8gmfvzpkmgq5l1hlsiyg2h46w881lwg2"; })
|
||||
(fetchNuGet { pname = "System.Text.Json"; version = "4.6.0"; sha256 = "0ism236hwi0k6axssfq58s1d8lihplwiz058pdvl8al71hagri39"; })
|
||||
];
|
||||
} "test-writers-fsharp" ''
|
||||
# Commented out because fails with 'error FS0039: The value or constructor 'JsonFSharpConverter' is not defined.'
|
||||
|
||||
#r "nuget: FSharp.SystemTextJson, 0.17.4"
|
||||
|
||||
module Json =
|
||||
open System.Text.Json
|
||||
open System.Text.Json.Serialization
|
||||
let options = JsonSerializerOptions()
|
||||
options.Converters.Add(JsonFSharpConverter())
|
||||
let serialize<'a> (o: 'a) = JsonSerializer.Serialize<'a>(o, options)
|
||||
let deserialize<'a> (str: string) = JsonSerializer.Deserialize<'a>(str, options)
|
||||
|
||||
type Letter = A | B
|
||||
let a = {| Hello = Some "World"; Letter = A |}
|
||||
if a |> Json.serialize |> Json.deserialize |> (=) a
|
||||
then "success"
|
||||
else "failed"
|
||||
|> printfn "%s"
|
||||
'');
|
||||
# fsharp = expectSuccess (makeFSharpWriter {
|
||||
# libraries = { fetchNuGet }: [
|
||||
# (fetchNuGet { pname = "FSharp.SystemTextJson"; version = "0.17.4"; sha256 = "1bplzc9ybdqspii4q28l8gmfvzpkmgq5l1hlsiyg2h46w881lwg2"; })
|
||||
# (fetchNuGet { pname = "System.Text.Json"; version = "4.6.0"; sha256 = "0ism236hwi0k6axssfq58s1d8lihplwiz058pdvl8al71hagri39"; })
|
||||
# ];
|
||||
# } "test-writers-fsharp" ''
|
||||
#
|
||||
# #r "nuget: FSharp.SystemTextJson, 0.17.4"
|
||||
#
|
||||
# module Json =
|
||||
# open System.Text.Json
|
||||
# open System.Text.Json.Serialization
|
||||
# let options = JsonSerializerOptions()
|
||||
# options.Converters.Add(JsonFSharpConverter())
|
||||
# let serialize<'a> (o: 'a) = JsonSerializer.Serialize<'a>(o, options)
|
||||
# let deserialize<'a> (str: string) = JsonSerializer.Deserialize<'a>(str, options)
|
||||
#
|
||||
# type Letter = A | B
|
||||
# let a = {| Hello = Some "World"; Letter = A |}
|
||||
# if a |> Json.serialize |> Json.deserialize |> (=) a
|
||||
# then "success"
|
||||
# else "failed"
|
||||
# |> printfn "%s"
|
||||
# '');
|
||||
|
||||
#pypy2NoLibs = expectSuccess (writePyPy2 "test-writers-pypy2-no-libs" {} ''
|
||||
# print("success")
|
||||
|
Loading…
Reference in New Issue
Block a user