Skip to content

Commit

Permalink
Fixes smoke tests and adapted the expected output
Browse files Browse the repository at this point in the history
  • Loading branch information
limingchina committed Aug 4, 2023
1 parent 728b5d8 commit 3d6217e
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,8 @@
! License-Filename: LICENSE
!
!}}
{{#resolveName comment}}{{#unless this.isEmpty}}{{prefix this "/// "}}
///{{/unless}}{{/resolveName}}{{!!
}}{{#parameters}}{{#set self=this}}{{#resolveName comment}}{{#unless this.isEmpty}}
/// [{{resolveName self}}] {{prefix this "/// " skipFirstLine=true}}
///{{/unless}}{{/resolveName}}{{/set}}{{/parameters}}{{!!
}}{{#resolveName returnType.comment}}{{#unless this.isEmpty}}
/// Returns [{{resolveName returnType.typeRef}}]. {{prefix this "/// " skipFirstLine=true}}
///{{/unless}}{{/resolveName}}{{!!
}}{{#if thrownType}}{{#resolveName thrownType.comment}}{{#unless this.isEmpty}}
/// Throws [{{resolveName exception}}]. {{prefix this "/// " skipFirstLine=true}}
///{{/unless}}{{/resolveName}}{{/if}}{{!!
}}{{#ifPredicate "needsNoDoc"}}
/// @nodoc{{/ifPredicate}}{{!!
}}{{#if attributes.deprecated}}
@Deprecated("{{#resolveName attributes.deprecated.message}}{{escape this}}{{/resolveName}}")
{{/if}}{{!!
}}{{#if attributes.dart.attribute}}
{{>dart/DartLambdaDocs}}
{{#if attributes.dart.attribute}}

{{#attributes.dart.attribute}}
@{{this}}{{#if iter.hasNext}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
! License-Filename: LICENSE
!
!}}
{{>dart/DartFunctionDocs}}{{>dart/DartAttributes}}
{{>dart/DartLambdaDocs}}

{{>dart/DartAttributes}}
typedef {{resolveName}} = {{>dart/DartLambdaType}};

// {{resolveName}} "private" section, not exported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class _GLUECODIUM_CPP_EXPORT Comments {
};
/**
* This is some very useful lambda that does it.
* \param[in] ::std::string Very useful input parameter
* \param[in] int32_t Slightly less useful input parameter
* \return Usefulness of the input
*/
using SomeLambda = ::std::function<double(const ::std::string&, const int32_t)>;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class _GLUECODIUM_CPP_EXPORT ExcludedComments {
/**
* This is some very useful lambda that does it.
* \private
* \param[in] ::std::string Very useful input parameter
* \param[in] int32_t Slightly less useful input parameter
* \return Usefulness of the input
*/
using SomeLambda = ::std::function<double(const ::std::string&, const int32_t)>;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class _GLUECODIUM_CPP_EXPORT ExcludedCommentsOnly {
USELESS
};
/**
*
* \private
* \param[in] ::std::string
* \param[in] int32_t
* \return
*/
using SomeLambda = ::std::function<double(const ::std::string&, const int32_t)>;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ void smokeCommentsSomestructReleaseFfiHandleNullable(Pointer<Void> handle) =>
_smokeCommentsSomestructReleaseHandleNullable(handle);
// End of Comments_SomeStruct "private" section.
/// This is some very useful lambda that does it.
///
/// [String] Very useful input parameter
///
/// [int] Slightly less useful input parameter
///
/// Returns [double]. Usefulness of the input
///
typedef Comments_SomeLambda = double Function(String, int);
// Comments_SomeLambda "private" section, not exported.
final _smokeCommentsSomelambdaRegisterFinalizer = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ void smokeExcludedcommentsSomestructReleaseFfiHandleNullable(Pointer<Void> handl
_smokeExcludedcommentsSomestructReleaseHandleNullable(handle);
// End of ExcludedComments_SomeStruct "private" section.
/// This is some very useful lambda that does it.
///
/// [String] Very useful input parameter
///
/// [int] Slightly less useful input parameter
///
/// Returns [double]. Usefulness of the input
///
/// @nodoc
typedef ExcludedComments_SomeLambda = double Function(String, int);
// ExcludedComments_SomeLambda "private" section, not exported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class Comments {
/// This is some very useful exception.
public typealias SomethingWrongError = Comments.SomeEnum
/// This is some very useful lambda that does it.
/// - Parameters:
/// - String: Very useful input parameter
/// - Int32: Slightly less useful input parameter
/// - Returns: Usefulness of the input
public typealias SomeLambda = (String, Int32) -> Double
/// This is some very useful constant.
public static let veryUseful: Comments.Usefulness = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public class ExcludedComments {
/// :nodoc:
public typealias SomethingWrongError = ExcludedComments.SomeEnum
/// This is some very useful lambda that does it.
/// - Parameters:
/// - String: Very useful input parameter
/// - Int32: Slightly less useful input parameter
/// - Returns: Usefulness of the input
/// :nodoc:
public typealias SomeLambda = (String, Int32) -> Double
/// This is some very useful constant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ public class ExcludedCommentsOnly {
public typealias Usefulness = Bool
/// :nodoc:
public typealias SomethingWrongError = ExcludedCommentsOnly.SomeEnum
///
/// - Parameters:
/// - String:
/// - Int32:
/// - Returns:
/// :nodoc:
public typealias SomeLambda = (String, Int32) -> Double
/// :nodoc:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class _GLUECODIUM_CPP_EXPORT Lambdas {
using Producer = ::std::function<::std::string()>;
/**
* Should confuse everyone thoroughly
* \param[in] ::std::string
* \return
*/
using Confuser = ::std::function<::smoke::Lambdas::Producer(const ::std::string&)>;
using Consumer = ::std::function<void(const ::std::string&)>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void smokeLambdasProducerReleaseFfiHandleNullable(Pointer<Void> handle) =>
_smokeLambdasProducerReleaseHandleNullable(handle);
// End of Lambdas_Producer "private" section.
/// Should confuse everyone thoroughly
///
typedef Lambdas_Confuser = Lambdas_Producer Function(String);
// Lambdas_Confuser "private" section, not exported.
final _smokeLambdasConfuserRegisterFinalizer = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Foundation
public class Lambdas {
public typealias Producer = () -> String
/// Should confuse everyone thoroughly
/// - Parameter String:
/// - Returns:
public typealias Convoluter = (String) -> Lambdas.Producer
public typealias Consumer = (String) -> Void
public typealias Indexer = (String, Float) -> Int32
Expand Down

0 comments on commit 3d6217e

Please sign in to comment.