1
1
describe ( "Tests Kotlin properties support" , function ( ) {
2
- it ( "Test Kotlin JvmField properties should work" , function ( ) {
3
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
4
-
5
- expect ( kotlinClass . jvmField ) . toBe ( 0 ) ;
6
-
7
- kotlinClass . jvmField = 1 ;
8
-
9
- expect ( kotlinClass . jvmField ) . toBe ( 1 ) ;
10
- } ) ;
11
-
12
-
13
- it ( "Test Kotlin public properties should work" , function ( ) {
14
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
15
-
16
- expect ( kotlinClass . immutableProperty ) . toBe ( "someImmutableProperty" ) ;
17
- try {
18
- kotlinClass . immutableProperty = "SHOULD NOT WORK" ;
19
- fail ( ) ;
20
- } catch { }
21
-
22
- expect ( kotlinClass . mutableProperty ) . toBe ( "someMutableProperty" ) ;
23
- kotlinClass . mutableProperty = "someOtherMutableProperty" ;
24
- expect ( kotlinClass . mutableProperty ) . toBe ( "someOtherMutableProperty" ) ;
25
- } ) ;
26
-
27
- it ( "Test Kotlin private properties should not work" , function ( ) {
28
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
29
-
30
- expect ( kotlinClass . privateMutableProperty ) . toBe ( undefined ) ;
31
- expect ( kotlinClass . privateImmutableProperty ) . toBe ( undefined ) ;
32
- } ) ;
33
-
34
- it ( "Test Kotlin internal properties should not work" , function ( ) {
35
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
36
-
37
- expect ( kotlinClass . internalMutableProperty ) . toBe ( undefined ) ;
38
- expect ( kotlinClass . internalImmutableProperty ) . toBe ( undefined ) ;
39
- } ) ;
40
-
41
- it ( "Test Kotlin protected properties should work" , function ( ) {
42
- var kotlinClass = new ( com . tns . tests . kotlin . properties . KotlinClassWithProperties . extend ( {
43
- getProtectedMutableProperty : function ( ) {
44
- expect ( this . super . protectedMutableProperty ) . toBe ( "someProtectedMutableProperty" ) ;
45
- this . super . protectedMutableProperty = "someOtherProtectedMutableProperty" ;
46
- expect ( this . super . protectedMutableProperty ) . toBe ( "someOtherProtectedMutableProperty" ) ;
47
- } ,
48
- getProtectedImmutableProperty : function ( ) {
49
- expect ( this . super . protectedImmutableProperty ) . toBe ( "someProtectedImmutableProperty" ) ;
50
- try {
51
- this . super . protectedImmutableProperty = "SHOULD NOT WORK" ;
52
- fail ( ) ;
53
- } catch { }
54
- }
55
- } ) ) ( ) ;
56
-
57
- kotlinClass . getProtectedMutableProperty ( ) ;
58
- kotlinClass . getProtectedImmutableProperty ( ) ;
59
- } ) ;
60
-
61
-
62
- it ( "Test Kotlin property private should not work" , function ( ) {
63
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
64
- try {
65
- kotlinClass . privateSetterProperty = "SHOULD NOT WORK" ;
66
- fail ( ) ;
67
- } catch { }
68
- } ) ;
69
-
70
- it ( "Test Kotlin boolean property should work" , function ( ) {
71
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
72
-
73
- expect ( kotlinClass . isMutableBooleanProperty ( ) ) . toBe ( true ) ;
74
- kotlinClass . setMutableBooleanProperty ( false ) ;
75
- expect ( kotlinClass . isMutableBooleanProperty ( ) ) . toBe ( false ) ;
76
- } ) ;
77
-
78
- it ( "Test Kotlin property with complext type should work" , function ( ) {
79
- var kotlinClass = new com . tns . tests . kotlin . properties . KotlinClassWithProperties ( ) ;
80
-
81
- expect ( kotlinClass . mutablePropertyWithComplexType . someString ) . toBe ( "test" ) ;
82
-
83
- var simpleObject = new com . tns . tests . kotlin . SimpleKotlinObject ( ) ;
84
- kotlinClass . mutablePropertyWithComplexType = simpleObject ;
85
- expect ( kotlinClass . mutablePropertyWithComplexType . equals ( simpleObject ) ) . toBe ( true ) ;
2
+ // it("Test Kotlin JvmField properties should work", function () {
3
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
4
+ //
5
+ // expect(kotlinClass.jvmField).toBe(0);
6
+ //
7
+ // kotlinClass.jvmField = 1;
8
+ //
9
+ // expect(kotlinClass.jvmField).toBe(1);
10
+ // });
11
+ //
12
+ //
13
+ // it("Test Kotlin public properties should work", function () {
14
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
15
+ //
16
+ // expect(kotlinClass.immutableProperty).toBe("someImmutableProperty");
17
+ // try{
18
+ // kotlinClass.immutableProperty = "SHOULD NOT WORK";
19
+ // fail();
20
+ // } catch{}
21
+ //
22
+ // expect(kotlinClass.mutableProperty).toBe("someMutableProperty");
23
+ // kotlinClass.mutableProperty = "someOtherMutableProperty";
24
+ // expect(kotlinClass.mutableProperty).toBe("someOtherMutableProperty");
25
+ // });
26
+ //
27
+ // it("Test Kotlin private properties should not work", function () {
28
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
29
+ //
30
+ // expect(kotlinClass.privateMutableProperty).toBe(undefined);
31
+ // expect(kotlinClass.privateImmutableProperty).toBe(undefined);
32
+ // });
33
+ //
34
+ // it("Test Kotlin internal properties should not work", function () {
35
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
36
+ //
37
+ // expect(kotlinClass.internalMutableProperty).toBe(undefined);
38
+ // expect(kotlinClass.internalImmutableProperty).toBe(undefined);
39
+ // });
40
+ //
41
+ // it("Test Kotlin protected properties should work", function () {
42
+ // var kotlinClass = new (com.tns.tests.kotlin.properties.KotlinClassWithProperties.extend({
43
+ // getProtectedMutableProperty: function(){
44
+ // expect(this.super.protectedMutableProperty).toBe("someProtectedMutableProperty");
45
+ // this.super.protectedMutableProperty = "someOtherProtectedMutableProperty";
46
+ // expect(this.super.protectedMutableProperty).toBe("someOtherProtectedMutableProperty");
47
+ // },
48
+ // getProtectedImmutableProperty: function(){
49
+ // expect(this.super.protectedImmutableProperty).toBe("someProtectedImmutableProperty");
50
+ // try{
51
+ // this.super.protectedImmutableProperty = "SHOULD NOT WORK";
52
+ // fail();
53
+ // } catch {}
54
+ // }
55
+ // }))();
56
+ //
57
+ // kotlinClass.getProtectedMutableProperty();
58
+ // kotlinClass.getProtectedImmutableProperty();
59
+ // });
60
+ //
61
+ //
62
+ // it("Test Kotlin property private should not work", function () {
63
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
64
+ // try{
65
+ // kotlinClass.privateSetterProperty = "SHOULD NOT WORK";
66
+ // fail();
67
+ // } catch {}
68
+ // });
69
+ //
70
+ // it("Test Kotlin boolean property should work", function () {
71
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
72
+ //
73
+ // expect(kotlinClass.isMutableBooleanProperty()).toBe(true);
74
+ // kotlinClass.setMutableBooleanProperty(false);
75
+ // expect(kotlinClass.isMutableBooleanProperty()).toBe(false);
76
+ // });
77
+ //
78
+ // it("Test Kotlin property with complext type should work", function () {
79
+ // var kotlinClass = new com.tns.tests.kotlin.properties.KotlinClassWithProperties();
80
+ //
81
+ // expect(kotlinClass.mutablePropertyWithComplexType.someString).toBe("test");
82
+ //
83
+ // var simpleObject = new com.tns.tests.kotlin.SimpleKotlinObject();
84
+ // kotlinClass.mutablePropertyWithComplexType = simpleObject;
85
+ // expect(kotlinClass.mutablePropertyWithComplexType.equals(simpleObject)).toBe(true);
86
+ // });
87
+
88
+ it ( "Test Kotlin @get:JvmName properties should work" , function ( ) {
89
+ for ( let i = 0 ; i < 100 ; i ++ ) {
90
+ var builder = new com . tns . tests . kotlin . properties . KotlinClassWithInternalConstructor . Builder ( ) ;
91
+ builder . scheme ( 'http' ) ;
92
+ const res = builder . build ( ) ;
93
+ expect ( res . scheme ( ) ) . toBe ( 'http' ) ;
94
+ expect ( res . schemeDifferent ( ) ) . toBe ( 'http' ) ;
95
+ }
86
96
} ) ;
87
97
} ) ;
0 commit comments