Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Feb 13, 2020
1 parent 297e22a commit 029b892
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions TypedocConverter.Test/test.expected
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace TypedocConverter.Test
"A" => UnionStr.A,
"B" => UnionStr.B,
"C" => UnionStr.C,
"Other" => UnionStr.Other,
"other" => UnionStr.Other,
_ => throw new System.Exception("Cannot unmarshal type UnionStr")
},
_ => throw new System.Exception("Cannot unmarshal type UnionStr")
Expand All @@ -163,7 +163,7 @@ namespace TypedocConverter.Test
case UnionStr.A: serializer.Serialize(writer, "A"); return;
case UnionStr.B: serializer.Serialize(writer, "B"); return;
case UnionStr.C: serializer.Serialize(writer, "C"); return;
case UnionStr.Other: serializer.Serialize(writer, "Other"); return;
case UnionStr.Other: serializer.Serialize(writer, "other"); return;
default: break;
}
throw new System.Exception("Cannot marshal type UnionStr");
Expand Down
2 changes: 1 addition & 1 deletion TypedocConverter/EnumParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let parseEnum (section: string) (node: Reflection): Entity =
| _ -> ""
let mutable intValue = 0L
match x.DefaultValue with
| Some value -> if Int64.TryParse(value, &intValue) then { Comment = comment; Name = toPascalCase x.Name; Value = Some intValue; }
| Some value -> if Int64.TryParse(value, &intValue) then { Comment = comment; Name = x.Name; Value = Some intValue; }
else match getEnumReferencedValue values value x.Name with
| Some t -> { Comment = comment; Name = x.Name; Value = Some (int64 t); }
| _ -> { Comment = comment; Name = x.Name; Value = None; }
Expand Down
2 changes: 1 addition & 1 deletion TypedocConverter/Helpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ and getGenericTypeParameters (nodes: Reflection list) = // TODO: generate consta
|> List.map (fun x -> x.Name)
types |> List.map (fun x -> {| Type = x; Constraint = "" |})
and typeSorter typeA typeB =
let typesOrder = ["array"; "tuple"; "reference"; "intrinsic"]
let typesOrder = ["array"; "tuple"; "reference"; "reflection"; "stringLiteral"; "intrinsic"]
let indexA = typesOrder |> List.tryFindIndex (fun x -> x = typeA.Type)
let indexB = typesOrder |> List.tryFindIndex (fun x -> x = typeB.Type)
match (indexA, indexB) with
Expand Down
2 changes: 1 addition & 1 deletion TypedocConverter/TypeAliasParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let parseUnionTypeAlias (section: string) (node: Reflection) (nodes: Type list):
match x.Value with
| Some value ->
[{
Name = toPascalCase value
Name = value
Comment = "///<summary>\n" + toCommentText value + "\n///</summary>"
Value = None
}]
Expand Down

0 comments on commit 029b892

Please sign in to comment.