OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library fletchc.message_examples; | 5 library dartino_compiler.message_examples; |
6 | 6 |
7 import 'messages.dart' show | 7 import 'messages.dart' show |
8 DiagnosticKind; | 8 DiagnosticKind; |
9 | 9 |
10 /// According to | 10 /// According to |
11 /// http://stackoverflow.com/questions/10456044/what-is-a-good-invalid-ip-addres
s-to-use-for-unit-tests, | 11 /// http://stackoverflow.com/questions/10456044/what-is-a-good-invalid-ip-addres
s-to-use-for-unit-tests, |
12 /// any IP address starting with 0 is unroutable. | 12 /// any IP address starting with 0 is unroutable. |
13 const String invalidIP = '0.42.42.42'; | 13 const String invalidIP = '0.42.42.42'; |
14 | 14 |
15 const String invalidAddress = '$invalidIP:61366'; | 15 const String invalidAddress = '$invalidIP:61366'; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 new CommandLineExample( | 64 new CommandLineExample( |
65 <String>['x-end', 'session', 'foo'])]; | 65 <String>['x-end', 'session', 'foo'])]; |
66 | 66 |
67 case DiagnosticKind.sessionAlreadyExists: | 67 case DiagnosticKind.sessionAlreadyExists: |
68 return <Example>[new CommandLineExample( | 68 return <Example>[new CommandLineExample( |
69 <String>['create', 'session', 'foo'], | 69 <String>['create', 'session', 'foo'], |
70 <String>['create', 'session', 'foo'])]; | 70 <String>['create', 'session', 'foo'])]; |
71 | 71 |
72 case DiagnosticKind.sessionInvalidState: | 72 case DiagnosticKind.sessionInvalidState: |
73 // TODO(wibling): figure out a way to test this. | 73 // TODO(wibling): figure out a way to test this. |
74 // Basically we need to have a fletch-vm that is | 74 // Basically we need to have a dartino-vm that is |
75 // explicitly attached to via 'fletch attach' and | 75 // explicitly attached to via 'dartino attach' and |
76 // have it in a state where it has thrown an uncaught | 76 // have it in a state where it has thrown an uncaught |
77 // exception and then call e.g. 'fletch run foo.dart'. | 77 // exception and then call e.g. 'dartino run foo.dart'. |
78 return untestable; | 78 return untestable; |
79 | 79 |
80 case DiagnosticKind.noFileTarget: | 80 case DiagnosticKind.noFileTarget: |
81 return <Example>[ | 81 return <Example>[ |
82 new CommandLineExample( | 82 new CommandLineExample( |
83 <String>['create', 'session', 'foo'], | 83 <String>['create', 'session', 'foo'], |
84 <String>['compile', 'in', 'session', 'foo'])]; | 84 <String>['compile', 'in', 'session', 'foo'])]; |
85 | 85 |
86 case DiagnosticKind.noTcpSocketTarget: | 86 case DiagnosticKind.noTcpSocketTarget: |
87 return <Example>[new CommandLineExample( | 87 return <Example>[new CommandLineExample( |
(...skipping 12 matching lines...) Expand all Loading... |
100 <String>['attach', 'in', 'session', 'foo', | 100 <String>['attach', 'in', 'session', 'foo', |
101 'tcp_socket', '$invalidIP:fisk'])]; | 101 'tcp_socket', '$invalidIP:fisk'])]; |
102 | 102 |
103 case DiagnosticKind.noAgentFound: | 103 case DiagnosticKind.noAgentFound: |
104 // TODO(karlklose,268): We want to write a test similar to the following, | 104 // TODO(karlklose,268): We want to write a test similar to the following, |
105 // but it records the error in the wrong isolate. We need a way to | 105 // but it records the error in the wrong isolate. We need a way to |
106 // test this. | 106 // test this. |
107 // return <Example>[new CommandLineExample( | 107 // return <Example>[new CommandLineExample( |
108 // <String>['create', 'session', 'foo'], | 108 // <String>['create', 'session', 'foo'], |
109 // <String>['x-upgrade', 'agent', | 109 // <String>['x-upgrade', 'agent', |
110 // 'with', 'file', 'fletch-agent_v1_platform.deb', | 110 // 'with', 'file', 'dartino-agent_v1_platform.deb', |
111 // 'in', 'session', 'foo' | 111 // 'in', 'session', 'foo' |
112 // ])]; | 112 // ])]; |
113 return untestable; | 113 return untestable; |
114 | 114 |
115 case DiagnosticKind.upgradeInvalidPackageName: | 115 case DiagnosticKind.upgradeInvalidPackageName: |
116 // TODO(karlklose,268): We want to write a test similar to the following, | 116 // TODO(karlklose,268): We want to write a test similar to the following, |
117 // but it records the error in the wrong isolate. We need a way to | 117 // but it records the error in the wrong isolate. We need a way to |
118 // test this. | 118 // test this. |
119 // return <Example>[new CommandLineExample( | 119 // return <Example>[new CommandLineExample( |
120 // <String>['x-upgrade', 'agent', 'with', 'file', | 120 // <String>['x-upgrade', 'agent', 'with', 'file', |
121 // 'invalid-file-name'])]; | 121 // 'invalid-file-name'])]; |
122 return untestable; | 122 return untestable; |
123 | 123 |
124 case DiagnosticKind.socketAgentConnectError: | 124 case DiagnosticKind.socketAgentConnectError: |
125 // TODO(wibling,268): figure out how to test fletch agent failures to | 125 // TODO(wibling,268): figure out how to test dartino agent failures to |
126 // exercise this error. | 126 // exercise this error. |
127 return untestable; | 127 return untestable; |
128 | 128 |
129 case DiagnosticKind.socketAgentReplyError: | 129 case DiagnosticKind.socketAgentReplyError: |
130 // TODO(wibling,268): figure out how to test fletch agent failures to | 130 // TODO(wibling,268): figure out how to test dartino agent failures to |
131 // exercise this error. | 131 // exercise this error. |
132 return untestable; | 132 return untestable; |
133 | 133 |
134 case DiagnosticKind.socketVmConnectError: | 134 case DiagnosticKind.socketVmConnectError: |
135 return <Example>[new CommandLineExample( | 135 return <Example>[new CommandLineExample( |
136 <String>['create', 'session', 'foo'], | 136 <String>['create', 'session', 'foo'], |
137 <String>['attach', 'in', 'session', 'foo', | 137 <String>['attach', 'in', 'session', 'foo', |
138 'tcp_socket', invalidAddress])]; | 138 'tcp_socket', invalidAddress])]; |
139 | 139 |
140 case DiagnosticKind.socketVmReplyError: | 140 case DiagnosticKind.socketVmReplyError: |
141 // TODO(wibling): figure out how to simulate fletch vm failures to | 141 // TODO(wibling): figure out how to simulate dartino vm failures to |
142 // exercise this error. | 142 // exercise this error. |
143 return untestable; | 143 return untestable; |
144 | 144 |
145 case DiagnosticKind.attachToVmBeforeRun: | 145 case DiagnosticKind.attachToVmBeforeRun: |
146 return <Example>[ | 146 return <Example>[ |
147 new CommandLineExample( | 147 new CommandLineExample( |
148 <String>['create', 'session', 'foo'], | 148 <String>['create', 'session', 'foo'], |
149 <String>['debug', 'in', 'session', 'foo']), | 149 <String>['debug', 'in', 'session', 'foo']), |
150 new CommandLineExample( | 150 new CommandLineExample( |
151 <String>['create', 'session', 'foo'], | 151 <String>['create', 'session', 'foo'], |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 class SettingsExample extends Example { | 367 class SettingsExample extends Example { |
368 final String data; | 368 final String data; |
369 | 369 |
370 const SettingsExample(this.data); | 370 const SettingsExample(this.data); |
371 } | 371 } |
372 | 372 |
373 class Untestable extends Example { | 373 class Untestable extends Example { |
374 const Untestable(); | 374 const Untestable(); |
375 } | 375 } |
OLD | NEW |