blob: 17682bed90ea2b533b9f904e8cb9e484e41b625e [file] [log] [blame]
#!/usr/bin/env dart
// Copyright (c) 2015, 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.
library client_generator_test;
import 'package:protoc_plugin/indenting_writer.dart';
import 'package:protoc_plugin/protoc.dart';
import 'package:test/test.dart';
import 'golden_file.dart';
import 'service_util.dart';
void main() {
test('testClientGenerator', () {
var options = new GenerationOptions();
var fd = buildFileDescriptor("testpkg", ["SomeRequest", "SomeReply"]);
var fg = new FileGenerator(fd, options);
var fd2 = buildFileDescriptor("", ["EmptyMessage", "AnotherReply"]);
var fg2 = new FileGenerator(fd2, options);
link(new GenerationOptions(), [fg, fg2]);
ClientApiGenerator cag = fg.clientApiGenerators[0];
IndentingWriter writer = new IndentingWriter();
expectMatchesGoldenFile(writer.toString(), 'test/goldens/client');