Support for Swift and Objective-C dependencies
This commit is contained in:
parent
4704cc427c
commit
ca4bb4a271
4 changed files with 141 additions and 0 deletions
18
tests/samples/codefiles/objective-c.m
Normal file
18
tests/samples/codefiles/objective-c.m
Normal file
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// Objective-C.m
|
||||
//
|
||||
|
||||
#import "SomeViewController.h"
|
||||
#import <UIKit.h>
|
||||
#import <PromiseKit/Something.h>
|
||||
|
||||
@interface ViewController : UIViewController
|
||||
@property (nonnull, strong) URL *url;
|
||||
@end
|
||||
|
||||
@implementation ViewController {
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// noop
|
||||
}
|
||||
@end
|
16
tests/samples/codefiles/swift.swift
Normal file
16
tests/samples/codefiles/swift.swift
Normal file
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// Swift.swift
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import PromiseKit
|
||||
|
||||
class ViewController: UIViewController {
|
||||
|
||||
private var attribute: URL?
|
||||
|
||||
override func viewDidLoad() {
|
||||
// noop
|
||||
}
|
||||
}
|
|
@ -397,3 +397,26 @@ class DependenciesTestCase(TestCase):
|
|||
expected_lines=37,
|
||||
entity='typescript.ts',
|
||||
)
|
||||
|
||||
def test_swift_dependencies_detected(self):
|
||||
self.shared(
|
||||
expected_dependencies=[
|
||||
'UIKit',
|
||||
'PromiseKit',
|
||||
],
|
||||
expected_language='Swift',
|
||||
expected_lines=16,
|
||||
entity='swift.swift',
|
||||
)
|
||||
|
||||
def test_objective_c_dependencies_detected(self):
|
||||
self.shared(
|
||||
expected_dependencies=[
|
||||
'SomeViewController',
|
||||
'UIKit',
|
||||
'PromiseKit',
|
||||
],
|
||||
expected_language='Objective-C',
|
||||
expected_lines=18,
|
||||
entity='objective-c.m',
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue