mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-03 22:33:26 +02:00
with input objects
This commit is contained in:
@@ -15,7 +15,33 @@ mod tests {
|
||||
fn can_generate_from_schema() {
|
||||
let schema: IntrospectionResponse = serde_json::from_str(INTROSPECTION_QUERY).unwrap();
|
||||
let code = CodeGeneration::new().generate(&schema).unwrap();
|
||||
assert_eq!("some-code", code);
|
||||
let expected = "use dagger_core::Scalar;
|
||||
|
||||
// code generated by dagger. DO NOT EDIT.
|
||||
|
||||
/// A global cache volume identifier.
|
||||
pub struct CacheID(Scalar);
|
||||
|
||||
/// A content-addressed directory identifier.
|
||||
pub struct DirectoryID(Scalar);
|
||||
|
||||
/// A file identifier.
|
||||
pub struct FileID(Scalar);
|
||||
|
||||
/// A unique identifier for a secret.
|
||||
pub struct SecretID(Scalar);
|
||||
|
||||
/// The platform config OS and architecture in a Container.
|
||||
/// The format is [os]/[platform]/[version] (e.g. darwin/arm64/v7, windows/amd64, linux/arm64).
|
||||
pub struct Platform(Scalar);
|
||||
|
||||
/// A unique container identifier. Null designates an empty container (scratch).
|
||||
pub struct ContainerID(Scalar);
|
||||
|
||||
/// A content-addressed socket identifier.
|
||||
pub struct SocketID(Scalar);
|
||||
";
|
||||
assert_eq!(expected, code);
|
||||
}
|
||||
|
||||
const INTROSPECTION_QUERY: &str = r#"{
|
||||
|
Reference in New Issue
Block a user