David PHAM-VAN

Fix unit tests

... ... @@ -97,9 +97,9 @@ get: $(FONTS) pdf/pubspec.lock printing/pubspec.lock demo/pubspec.lock test/pubs
get-all: $(FONTS) demo/assets/logo.svg demo/assets/profile.jpg get
test-pdf: svg $(FONTS) pdf/pubspec.lock .coverage
cd pdf; $(DART_BIN) pub global run coverage:collect_coverage --port=$(COV_PORT) -o coverage.json --resume-isolates --wait-paused &\
$(DART_BIN) --enable-asserts --disable-service-auth-codes --enable-vm-service=$(COV_PORT) --pause-isolates-on-exit test/all_tests.dart
cd pdf; $(DART_BIN) pub global run coverage:format_coverage --package=. -i coverage.json --report-on lib --lcov --out lcov.info
cd pdf; $(DART_BIN) run --enable-asserts --pause-isolates-on-exit --disable-service-auth-codes --enable-vm-service=$(COV_PORT) test &\
$(DART_BIN) pub global run coverage:collect_coverage --wait-paused --uri=http://127.0.0.1:$(COV_PORT)/ -o coverage.json --resume-isolates --scope-output=pdf
cd pdf; $(DART_BIN) pub global run coverage:format_coverage --packages=.dart_tool/package_config.json -i coverage.json --report-on lib --lcov --out lcov.info
cd pdf; for EXAMPLE in $(shell cd pdf; find example -name '*.dart'); do $(DART_BIN) $$EXAMPLE; done
test/compare-pdf.sh pdf test/golden
... ...
... ... @@ -5,6 +5,7 @@
- Improve TTF Writer compatibility
- Apply THE BIDIRECTIONAL ALGORITHM using dart_bidi [Milad akarie]
- Add Inseparable Widget
- Fix unit tests
## 3.8.4
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
library pdf.all_tests;
import '../example/main.dart' as example;
import 'annotations_test.dart' as annotations;
import 'arabic_test.dart' as arabic;
import 'colors_test.dart' as colors;
import 'complex_test.dart' as complex;
import 'data_types_test.dart' as data_types;
import 'isolate_test.dart' as isolate;
import 'jpeg_test.dart' as jpeg;
import 'metrics_test.dart' as metrics;
import 'minimal_test.dart' as minimal;
import 'orientation_test.dart' as orientation;
import 'roll_paper_test.dart' as roll;
import 'ttf_test.dart' as ttf;
import 'type1_test.dart' as type1;
import 'widget_barcode_test.dart' as widget_barcode;
import 'widget_basic_test.dart' as widget_basic;
import 'widget_chart_test.dart' as widget_chart;
import 'widget_clip_test.dart' as widget_clip;
import 'widget_container_test.dart' as widget_container;
import 'widget_flex_test.dart' as widget_flex;
import 'widget_form_test.dart' as widget_form;
import 'widget_grid_view_test.dart' as widget_grid_view;
import 'widget_icon_test.dart' as widget_icon;
import 'widget_multipage_test.dart' as widget_multipage;
import 'widget_opacity_test.dart' as widget_opacity;
import 'widget_outline_test.dart' as widget_outline;
import 'widget_partitions_test.dart' as widget_partitions;
import 'widget_svg_test.dart' as widget_svg;
import 'widget_table_test.dart' as widget_table;
import 'widget_test.dart' as widget;
import 'widget_text_test.dart' as widget_text;
import 'widget_theme_test.dart' as widget_theme;
import 'widget_toc_test.dart' as widget_toc;
import 'widget_watermark_test.dart' as widget_watermark;
import 'widget_wrap_test.dart' as widget_wrap;
void main() {
annotations.main();
arabic.main();
colors.main();
complex.main();
data_types.main();
example.main();
isolate.main();
jpeg.main();
metrics.main();
minimal.main();
orientation.main();
roll.main();
ttf.main();
type1.main();
widget_barcode.main();
widget_basic.main();
widget_chart.main();
widget_clip.main();
widget_container.main();
widget_flex.main();
widget_form.main();
widget_grid_view.main();
widget_icon.main();
widget_multipage.main();
widget_opacity.main();
widget_outline.main();
widget_partitions.main();
widget_svg.main();
widget_table.main();
widget_text.main();
widget_theme.main();
widget_toc.main();
widget_watermark.main();
widget_wrap.main();
widget.main();
}
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -37,7 +37,7 @@ TextStyle? style;
void main() {
setUpAll(() {
Document.debug = false;
Document.debug = true;
RichText.debug = true;
pdf = Document();
... ...
... ... @@ -173,6 +173,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document(pageMode: PdfPageMode.outlines);
});
... ...
... ... @@ -29,6 +29,7 @@ late MemoryImage image;
void main() {
setUpAll(() async {
Document.debug = true;
RichText.debug = true;
pdf = Document();
image = MemoryImage(
... ...
... ... @@ -100,6 +100,9 @@ void printMetrics(
void main() {
test('Pdf Font Metrics', () async {
Document.debug = true;
RichText.debug = true;
final pdf = Document();
PdfFont.courier(pdf.document);
... ...
... ... @@ -53,6 +53,7 @@ List<Widget> contentMultiPage(Context context) {
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -24,6 +24,7 @@ late Document pdf;
void main() {
setUpAll(() {
RichText.debug = true;
Document.debug = true;
pdf = Document();
});
... ...
... ... @@ -113,7 +113,7 @@ void hexDump(
}
}
}
s += b.toRadixString(16).padLeft(2, '0') + ' ';
s += '${b.toRadixString(16).padLeft(2, '0')} ';
if (b > 31 && b < 128) {
t += String.fromCharCode(b);
} else {
... ...
... ... @@ -54,7 +54,8 @@ Widget barcode(
void main() {
setUpAll(() {
// Document.debug = true;
RichText.debug = true;
Document.debug = true;
pdf = Document();
});
... ...
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -27,6 +27,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -65,7 +65,8 @@ class Decorated extends StatelessWidget {
void main() {
setUpAll(() {
// Document.debug = true;
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -24,6 +24,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -28,6 +28,7 @@ Font? icons;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
icons = loadFont('material.ttf');
});
... ...
... ... @@ -23,6 +23,9 @@ List<Widget> lines = <Widget>[];
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
for (var i = 0; i < 200; i++) {
lines.add(Text('Line $i'));
}
... ...
... ... @@ -24,6 +24,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -70,6 +70,7 @@ Iterable<Widget> level(int i) sync* {
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document(pageMode: PdfPageMode.outlines);
});
... ...
... ... @@ -24,6 +24,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -66,6 +66,7 @@ List<TableRow> buildTable(
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -29,6 +29,7 @@ void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
final defaultFont = File('open-sans.ttf').readAsBytesSync();
final defaultFontBold = File('open-sans-bold.ttf').readAsBytesSync();
... ...
... ... @@ -104,7 +104,7 @@ void main() {
for (final align in TextAlign.values) {
widgets.add(
Text(
'$align:\n' + para,
'$align:\n$para',
textAlign: align,
),
);
... ...
... ... @@ -25,6 +25,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...
... ... @@ -26,6 +26,7 @@ PageTheme? pageTheme;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
pageTheme = PageTheme(
... ...
... ... @@ -26,6 +26,7 @@ late Document pdf;
void main() {
setUpAll(() {
Document.debug = true;
RichText.debug = true;
pdf = Document();
});
... ...