[K/N][Tests] Move filecheck and cinterop tests to /native/
^KT-61259
This commit is contained in:
committed by
Space Team
parent
05cbe66ee0
commit
bf0150108d
@@ -0,0 +1,51 @@
|
||||
// TARGET_BACKEND: NATIVE
|
||||
// MODULE: cinterop_kt63048
|
||||
// FILE: kt63048.def
|
||||
language = Objective-C
|
||||
headers = kt63048.h
|
||||
|
||||
// FILE: kt63048.h
|
||||
#import "Foundation/NSString.h"
|
||||
#import "Foundation/NSObject.h"
|
||||
|
||||
@interface WithClassProperty : NSObject
|
||||
-(instancetype) init;
|
||||
@property (class, readonly, copy) NSString * stringProperty;
|
||||
@end
|
||||
|
||||
|
||||
// FILE: kt63048.m
|
||||
#import "kt63048.h"
|
||||
|
||||
@implementation WithClassProperty : NSObject
|
||||
-(instancetype) init {}
|
||||
+ (NSString *) stringProperty { return @"153"; }
|
||||
@end
|
||||
|
||||
|
||||
// MODULE: main(cinterop_kt63048)
|
||||
// FILE: main.kt
|
||||
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class, kotlin.experimental.ExperimentalObjCName::class)
|
||||
|
||||
import kt63048.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@ObjCName("KotlinImplWithCompanionPropertyOverride")
|
||||
class Impl : WithClassProperty() {
|
||||
companion object : WithClassPropertyMeta() {
|
||||
override fun stringProperty(): String? = "42"
|
||||
}
|
||||
}
|
||||
|
||||
@ObjCName("KotlinImplWithoutCompanionPropertyOverride")
|
||||
class ImplWithoutOverride : WithClassProperty() {
|
||||
companion object : WithClassPropertyMeta() {
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("42", Impl.stringProperty())
|
||||
assertEquals("153", ImplWithoutOverride.stringProperty())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user