-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b4217b
commit e935786
Showing
8 changed files
with
135 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
data class Data( | ||
val field0: Int, | ||
// Deprecated since build 500 | ||
// val field1: Int? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
struct Data { | ||
var field0: Int | ||
// Deprecated since build 500 | ||
// var field1: Int? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module DeprecatedFieldSpec where | ||
|
||
import Common | ||
import Moat | ||
import Test.Hspec | ||
import Test.Hspec.Golden | ||
|
||
data Data = Data | ||
{ field0 :: Int | ||
, field1 :: Maybe Int | ||
} | ||
|
||
mobileGenWith | ||
( defaultOptions | ||
{ fieldsRequiredByClients = ["field0", "field1"] | ||
, omitFields = const Discard | ||
, deprecatedFields = [("field1", Just "Deprecated since build 500")] | ||
} | ||
) | ||
''Data | ||
|
||
spec :: Spec | ||
spec = | ||
fdescribe "stays golden" $ do | ||
let moduleName = "DeprecatedFieldSpec" | ||
it "swift" $ | ||
defaultGolden ("swift" <> moduleName) (showSwift @Data) | ||
it "kotlin" $ | ||
defaultGolden ("kotlin" <> moduleName) (showKotlin @Data) |