Skip to content

Commit

Permalink
See #18. Beautify most of the expected tests.
Browse files Browse the repository at this point in the history
I was unable to do Python and SQL, as I am having Python problems on my
laptop. Hopefully I will be able to figure this out soon.
  • Loading branch information
Glavin001 committed Dec 28, 2014
1 parent b147ecd commit f8e0e44
Show file tree
Hide file tree
Showing 31 changed files with 1,307 additions and 1,309 deletions.
1,735 changes: 867 additions & 868 deletions examples/nested-jsbeautifyrc/c/expected/test.c

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions examples/nested-jsbeautifyrc/cpp/expected/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ fm_status fm2000EventHandlingInitialize(fm_int sw);
fm_status fm2000MacTableOverflowStart(fm_int sw);
fm_bool fm2000ProcessMATableEntry( fm_mac_table_work_list *pWork,
fm_int sw,
fm_int index,
fm_int index,
fm_thread * event_handler,
fm_uint32 * numUpdates,
fm_event **event);
void foo()
{
Logger log = new Logger();
Logger log= new Logger( );
Logger log = new Logger();
Logger log= new Logger( );

log.foo.bar = 5;
log.narf.sweat = "cat";
for (i = 0; i<5; i++) bar(i);
log.foo.bar = 5;
log.narf.sweat = "cat";
for (i = 0; i<5; i++) bar(i);
}
int this_works(int x);
int bug(int); // BUG: left-aligned
typedef int fooman;
enum FLAGS
{
FLAGS_decimal = 1, // decimal
FLAGS_unsigned = 2, // u or U suffix
FLAGS_long = 4, // l or L suffix
};
enum FLAGS
{
FLAGS_decimal = 1, // decimal
FLAGS_unsigned = 2, // u or U suffix
FLAGS_long = 4, // l or L suffix
};
9 changes: 5 additions & 4 deletions examples/nested-jsbeautifyrc/cpp/expected/test.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class Example
{

Example()
: member(0)
{}
Example()
: member(0)
{
}

int member;
int member;

};
140 changes: 70 additions & 70 deletions examples/nested-jsbeautifyrc/csharp/expected/test.cs
Original file line number Diff line number Diff line change
@@ -1,113 +1,113 @@
class X : Y {
bool Method (int argument_1, int argument_2)
{
#region something
int foo = 0;
#endregion

if (argument_1 == argument_2)
throw new Exception (Locale.GetText ("They are equal!"));

if (argument_1 < argument_2) {
if (argument_1 * 3 > 4)
return true;
else
return false;
}
#region something
int foo = 0;
#endregion

if (argument_1 == argument_2)
throw new Exception (Locale.GetText ("They are equal!"));

if (argument_1 < argument_2) {
if (argument_1 * 3 > 4)
return true;
else
return false;
}

//
// This sample helps keep your sanity while using 8-spaces for tabs
//
VeryLongIdentifierWhichTakesManyArguments (
Argument1,
Argument2, Argument3,
NestedCallHere (
MoreNested));
VeryLongIdentifierWhichTakesManyArguments (
Argument1,
Argument2, Argument3,
NestedCallHere (
MoreNested));
}

bool MyProperty {
get { return x; }
get { return x; }

set { x = value; }
set { x = value; }
}

void AnotherMethod ()
{
Logger log = new Logger();
log.foo.bar = 5;
log.narf.sweat = "cat";
Logger log = new Logger();
log.foo.bar = 5;
log.narf.sweat = "cat";

if ((a + 5) != 4) {
}
if ((a + 5) != 4) {
}

while (blah) {
if (a)
continue;
b++;
}
while (blah) {
if (a)
continue;
b++;
}
}
}

object lockA;
object lockB;

void Foo () {
lock (lockA) {
lock (lockB) {
}
}
lock (lockA) {
lock (lockB) {
}
}
}

void Bar () {
lock (lockB) {
lock (lockA) {
}
}
lock (lockB) {
lock (lockA) {
}
}
}


// class library
class Blah {
Hashtable ht;
void Foo (int zzz, Entry blah) {
lock (ht) {
ht.Add (zzz, blah);
}
}

void Bar ()
{
lock (ht) {
foreach (Entry e in ht)
EachBar (e);
}
}

virtual void EachBar (Entry e)
{
}
Hashtable ht;
void Foo (int zzz, Entry blah) {
lock (ht) {
ht.Add (zzz, blah);
}
}

void Bar ()
{
lock (ht) {
foreach (Entry e in ht)
EachBar (e);
}
}

virtual void EachBar (Entry e)
{
}
}

// User
class MyBlah {
byte[] box = new byte[6];
byte[] box = new byte[6];

box[2] = 56;
box[2] = 56;

void DoStuff ()
{
lock (this) {
int i = GetNumber ();
Entry e = GetEntry ();
void DoStuff ()
{
lock (this) {
int i = GetNumber ();
Entry e = GetEntry ();

Foo (i, e);
}
}
Foo (i, e);
}
}

override void EachBar (Entry e)
{
override void EachBar (Entry e)
{
lock (this) {
DoSomething (e);
DoSomething (e);
}
}
}
}
2 changes: 1 addition & 1 deletion examples/nested-jsbeautifyrc/css/original/test.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
p {
color: red;
color: red;
}
10 changes: 5 additions & 5 deletions examples/nested-jsbeautifyrc/html/expected/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html>

<head>
<title>Test Page</title>
<title>Test Page</title>
</head>

<body>
<h1>Hello</h1>
<p>
World!
</p>
<h1>Hello</h1>
<p>
World!
</p>
</body>

</html>
66 changes: 33 additions & 33 deletions examples/nested-jsbeautifyrc/java/expected/test.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
class Aligns {
final int SZF = 4;
final int SZ2F = 4;
final int aBarF;
final int someIntsF[];
final int someIntsSzdF[4];
final int[] someMoreIntsF;
final int lotsOfIntsF[][][][][][];
final int[][][][] lotsMoreIntsF;
final Tem<Plate> edVarF;
final int aBarSetF=null;
final int someIntsSetF[]=null;
final int someIntsSzdSetF[4]=null;
final int[] someMoreIntsSetF=null;
final int lotsOfIntsSetF[][][][][][]=null;
final int[][][][] lotsMoreIntsSetF=null;
final Tem<Plate> edVarF=null;
int SZ = 4;
int SZ2 = 4;
int aBar;
int someInts[];
int someIntsSzd[4];
int spacer;
int[] someMoreInts;
int lotsOfInts[][][][][][];
int[][][][] lotsMoreInts;
Tem<Plate> edVar;
int aBarSet=null;
int someIntsSet[]=null;
int someIntsSzdSet[4]=null;
int[] someMoreIntsSet=null;
int lotsOfIntsSet[][][][][][]=null;
int[][][][] lotsMoreIntsSet=null;
Tem<Plate> edVar=null;
final int SZF = 4;
final int SZ2F = 4;
final int aBarF;
final int someIntsF[];
final int someIntsSzdF[4];
final int[] someMoreIntsF;
final int lotsOfIntsF[][][][][][];
final int[][][][] lotsMoreIntsF;
final Tem<Plate> edVarF;
final int aBarSetF=null;
final int someIntsSetF[]=null;
final int someIntsSzdSetF[4]=null;
final int[] someMoreIntsSetF=null;
final int lotsOfIntsSetF[][][][][][]=null;
final int[][][][] lotsMoreIntsSetF=null;
final Tem<Plate> edVarF=null;
int SZ = 4;
int SZ2 = 4;
int aBar;
int someInts[];
int someIntsSzd[4];
int spacer;
int[] someMoreInts;
int lotsOfInts[][][][][][];
int[][][][] lotsMoreInts;
Tem<Plate> edVar;
int aBarSet=null;
int someIntsSet[]=null;
int someIntsSzdSet[4]=null;
int[] someMoreIntsSet=null;
int lotsOfIntsSet[][][][][][]=null;
int[][][][] lotsMoreIntsSet=null;
Tem<Plate> edVar=null;
}
2 changes: 1 addition & 1 deletion examples/nested-jsbeautifyrc/javascript/expected/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
function hell() {
console.log('world');
console.log('world');
}
8 changes: 4 additions & 4 deletions examples/nested-jsbeautifyrc/markdown/expected/test.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- item
1. one
2. two
3. three
- item
1. one
2. two
3. three
44 changes: 22 additions & 22 deletions examples/nested-jsbeautifyrc/objectivec/expected/test.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError {
#pragma unused(typeName)

// Produce the data lump:
NSData * retval = [NSKeyedArchiver archivedDataWithRootObject:model];
// Produce the data lump:
NSData * retval = [NSKeyedArchiver archivedDataWithRootObject:model];

// If the lump is nil something went wrong
// fill out the error object to explain what wrent wrong
if ( outError != NULL ) {
// The sender wanted an error reported. If there
// was a problem, fill in an NSError object
if (retval == nil) {
// The error object should include an (unhelpful)
// explanation of what happened
NSDictionary * userInfoDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Internal error formatting data", NSLocalizedDescriptionKey,
@"Archiving of data failed. Probably a bug.", NSLocalizedFailureReasonErrorKey,
@"There's nothing you can do.", NSLocalizedRecoverySuggestionErrorKey, nil];
// If the lump is nil something went wrong
// fill out the error object to explain what wrent wrong
if ( outError != NULL ) {
// The sender wanted an error reported. If there
// was a problem, fill in an NSError object
if (retval == nil) {
// The error object should include an (unhelpful)
// explanation of what happened
NSDictionary * userInfoDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Internal error formatting data", NSLocalizedDescriptionKey,
@"Archiving of data failed. Probably a bug.", NSLocalizedFailureReasonErrorKey,
@"There's nothing you can do.", NSLocalizedRecoverySuggestionErrorKey, nil];

*outError = [NSError errorWithDomain:LinearInternalErrorDomain
code:linErrCantFormatDocumentData
userInfo:userInfoDict];
} else {
// No problem. Don't supply an error object.
*outError = nil;
*outError = [NSError errorWithDomain:LinearInternalErrorDomain
code:linErrCantFormatDocumentData
userInfo:userInfoDict];
} else {
// No problem. Don't supply an error object.
*outError = nil;
}
}
}
return retval;
return retval;
}
Loading

0 comments on commit f8e0e44

Please sign in to comment.