[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dart-mode 07a9e76 189/192: Add failing font-lock test
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dart-mode 07a9e76 189/192: Add failing font-lock test |
Date: |
Sun, 29 Aug 2021 11:02:15 -0400 (EDT) |
branch: elpa/dart-mode
commit 07a9e76e7aa3b7f5e2b936e4d76461898a34d248
Author: Brady Trainor <mail@bradyt.net>
Commit: Brady Trainor <mail@bradyt.net>
Add failing font-lock test
---
test/credit.txt | 3 +++
test/faceup/stagehand/server.dart | 34 ++++++++++++++++++++++++++++++++
test/faceup/stagehand/server.dart.faceup | 34 ++++++++++++++++++++++++++++++++
test/test-font-lock.el | 4 ++++
4 files changed, 75 insertions(+)
diff --git a/test/credit.txt b/test/credit.txt
index 66155bb..655a18b 100644
--- a/test/credit.txt
+++ b/test/credit.txt
@@ -4,6 +4,9 @@ from https://dart.dev/samples.
The source code samples in the faceup/core/ directory were copied from
https://github.com/dart-lang/sdk. The following is copied from its LICENSE
file.
+The source code samples in the faceup/stagehand/ directory were copied from
+https://github.com/dart-lang/stagehand. The following is copied from its
LICENSE file.
+
Copyright 2012, the Dart project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/test/faceup/stagehand/server.dart
b/test/faceup/stagehand/server.dart
new file mode 100644
index 0000000..53b132e
--- /dev/null
+++ b/test/faceup/stagehand/server.dart
@@ -0,0 +1,34 @@
+import 'dart:io';
+
+import 'package:args/args.dart';
+import 'package:shelf/shelf.dart' as shelf;
+import 'package:shelf/shelf_io.dart' as io;
+
+// For Google Cloud Run, set _hostname to '0.0.0.0'.
+const _hostname = 'localhost';
+
+main(List<String> args) async {
+ var parser = ArgParser()..addOption('port', abbr: 'p');
+ var result = parser.parse(args);
+
+ // For Google Cloud Run, we respect the PORT environment variable
+ var portStr = result['port'] ?? Platform.environment['PORT'] ?? '8080';
+ var port = int.tryParse(portStr);
+
+ if (port == null) {
+ stdout.writeln('Could not parse port value "$portStr" into a number.');
+ // 64: command line usage error
+ exitCode = 64;
+ return;
+ }
+
+ var handler = const shelf.Pipeline()
+ .addMiddleware(shelf.logRequests())
+ .addHandler(_echoRequest);
+
+ var server = await io.serve(handler, _hostname, port);
+ print('Serving at http://${server.address.host}:${server.port}');
+}
+
+shelf.Response _echoRequest(shelf.Request request) =>
+ shelf.Response.ok('Request for "${request.url}"');
diff --git a/test/faceup/stagehand/server.dart.faceup
b/test/faceup/stagehand/server.dart.faceup
new file mode 100644
index 0000000..eaa4054
--- /dev/null
+++ b/test/faceup/stagehand/server.dart.faceup
@@ -0,0 +1,34 @@
+«b:import» «s:'dart:io'»;
+
+«b:import» «s:'package:args/args.dart'»;
+«b:import» «s:'package:shelf/shelf.dart'» «b:as» shelf;
+«b:import» «s:'package:shelf/shelf_io.dart'» «b:as» io;
+
+«m:// »«x:For Google Cloud Run, set _hostname to '0.0.0.0'.
+»«k:const» «v:_hostname» = «s:'localhost'»;
+
+«f:main»(«t:List»<«t:String»> «v:args») «k:async» {
+ «k:var» «v:parser» = «t:ArgParser»()..addOption(«s:'port'», abbr: «s:'p'»);
+ «k:var» «v:result» = parser.parse(args);
+
+ «m:// »«x:For Google Cloud Run, we respect the PORT environment variable
+» «k:var» «v:portStr» = result[«s:'port'»] ??
«t:Platform».environment[«s:'PORT'»] ?? «s:'8080'»;
+ «k:var» «v:port» = «t:int».tryParse(portStr);
+
+ «k:if» (port == «c:null») {
+ stdout.writeln(«s:'Could not parse port value "»«v:$portStr»«s:" into a
number.'»);
+ «m:// »«x:64: command line usage error
+» exitCode = «c:64»;
+ «k:return»;
+ }
+
+ «k:var» «v:handler» = «k:const» shelf.«t:Pipeline»()
+ .addMiddleware(shelf.logRequests())
+ .addHandler(_echoRequest);
+
+ «k:var» «v:server» = «k:await» io.serve(handler, _hostname, port);
+ print(«s:'Serving at
http://»«v:${server.address.host}»«s::»«v:${server.port}»«s:'»);
+}
+
+shelf.«t:Response» «f:_echoRequest»(shelf.«t:Request» «v:request») =>
+ shelf.«t:Response».ok(«s:'Request for "»«v:${request.url}»«s:"'»);
diff --git a/test/test-font-lock.el b/test/test-font-lock.el
index dad6b23..2c4de62 100644
--- a/test/test-font-lock.el
+++ b/test/test-font-lock.el
@@ -36,6 +36,10 @@
:expected-result :failed
(should (dart-font-lock-test-apps "faceup/issues/factory.dart")))
+(ert-deftest dart-font-lock-false-positive-test ()
+ :expected-result :failed
+ (should (dart-font-lock-test-apps "faceup/stagehand/server.dart")))
+
(ert-deftest dart-font-lock-generic-method-test ()
:expected-result :failed
(should (dart-font-lock-test-apps "faceup/issues/generic-method.dart")))
- [nongnu] elpa/dart-mode 1879cb8 145/192: Update README for providing diff to dart-format on Windows, (continued)
- [nongnu] elpa/dart-mode 1879cb8 145/192: Update README for providing diff to dart-format on Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 21abd77 152/192: Fontifies declared identifiers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ac14859 147/192: Normalize paths for dartanalyzer on Windows, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 9d72469 169/192: Don't set variables globally, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 591b6fe 170/192: Improve handling of strings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode f20f895 164/192: Move docs from README to Wiki, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 36fe2ce 166/192: Fontify identifiers after multi-nested types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 57767bb 157/192: Makes current indentation logic more usable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 90f1120 162/192: Require subr-x for string-empty-p, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 8983e17 186/192: Code in font-lock tests were copied from dart.dev site, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 07a9e76 189/192: Add failing font-lock test,
ELPA Syncer <=
- [nongnu] elpa/dart-mode 3c089f3 183/192: Fix font lock for abstract method, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 40f6741 150/192: Fontifies more keywords, builtins, constants and types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode d5776f1 172/192: Fixes fontification of small strings containing only backslashes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 5989dca 180/192: Fontify operator declaration, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 1c2cbe5 179/192: Add faceup tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 04fcd64 190/192: Treat angle brackets as puncutation syntax instead of symbol syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode e41f41e 174/192: Fontify untyped parameters in anonymous functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 43975c9 192/192: Add syntax highlighting for keywords extension, late, required, ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode ed80bc8 002/192: Set a bunch of CC-mode configuration vars., ELPA Syncer, 2021/08/29
- [nongnu] elpa/dart-mode 64eb399 003/192: Fix array literal indentation., ELPA Syncer, 2021/08/29