blob: e90a157ea4664ef88087e6c02f37718ae0aaaf26 [file] [log] [blame]
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/dart/error/ffi_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../dart/resolution/context_collection_resolution.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(FfiNativeTest);
});
}
@reflectiveTest
class FfiNativeTest extends PubPackageResolutionTest {
test_FfiNativeAnnotationOnInstanceMethod() async {
await assertErrorsInCode(r'''
import 'dart:ffi';
class K {
@FfiNative<Void Function()>('DoesntMatter')
external void doesntMatter();
}
''', [
error(FfiCode.FFI_NATIVE_ONLY_STATIC, 31, 75),
]);
}
}