Skip to content

Commit f1f5c67

Browse files
EvaristeGalois11google-java-format Team
authored andcommitted
Add simple native formatting test
As discussed in #1327 a very simple formatting test is added to the native build. It's a fairly basic smoke test, but I actually verified here EvaristeGalois11#1 that it's enough to catch problems like the recent bug 😁 Fixes #1331 COPYBARA_INTEGRATE_REVIEW=#1331 from EvaristeGalois11:native-test 04b4238 PiperOrigin-RevId: 866015724
1 parent ff157e3 commit f1f5c67

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

util/HelloWorld.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2026 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5+
* in compliance with the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License
10+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+
* or implied. See the License for the specific language governing permissions and limitations under
12+
* the License.
13+
*/
14+
15+
class HelloWorld {
16+
public static void main(String[] args) {
17+
System.out.println("Hello, World!");
18+
}
19+
}

util/test-native.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ if [[ $status -ne 2 ]]; then
2828
echo "google-java-format_linux (native) without arguments should have printed usage help and exited with 2, but did not :("
2929
exit 1
3030
fi
31+
32+
core/target/google-java-format util/HelloWorld.java

0 commit comments

Comments
 (0)