Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ We can use `nix-diff` to compare the two computed derivations to determine what
changed about our system:

```bash
$ nix-diff /nix/store/6z9nr5pzs4j1v9mld517dmlcz61zy78z-nixos-system-nixos-18.03pre119245.5cfd049a03.drv /nix/store/k05ibijg0kknvwrgfyb7dxwjrs8qrlbj-nixos-system-nixos-18.03pre119245.5cfd049a03.drv
$ nix-diff /nix/store/6z9nr5pzs4j1v9mld517dmlcz61zy78z-nixos-system-nixos-18.03pre119245.5cfd049a03.drv /nix/store/k05ibijg0kknvwrgfyb7dxwjrs8qrlbj-nixos-system-nixos-18.03pre119245.5cfd049a03.drv
```

... which produces the following output:
Expand All @@ -83,6 +83,12 @@ It's also possible to pass store paths or links to store paths, for example:
$ nix-build example.nix
$ nix-diff /run/current-system ./result
```
## Testing

You have to have `nix-diff` in PATH to run test from `golden-tests` folder.
You also have to be in that folder and to have nix in your system.

Basically, you can run test, using `cabal exec bash -- -c "cd golden-tests; ./run-test.sh"` command.

## Development status

Expand All @@ -96,7 +102,7 @@ an improvement.

Copyright (c) 2017 Gabriella Gonzalez
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
Expand All @@ -107,7 +113,7 @@ an improvement.
* Neither the name of Gabriella Gonzalez nor the names of other contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
174 changes: 174 additions & 0 deletions golden-tests/expected-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
- /nix/store/2bwmj0qp4m6fiah2b39qwpf1lw0l1a4v-drv.drv:{out}
+ /nix/store/bg0lxf2d20a3sif8vpfmxcl6hch8ls8h-drv.drv:{out}
• The arguments do not match
• one
- two
• three
+ four
• The set of input source names do not match:
- missing-file
+ new-file
• The input source named `changed-file` differs
''
When in the Course of human events it becomes necessary for one people to
dissolve the political bands which have connected them with another and to
assume among the powers of the earth, the separate and equal station to which
the Laws of Nature and of Nature's ←God←→Dog→ entitle them, a decent respect to the
opinions of mankind requires that they should declare the causes which impel
them to the separation.
We hold these truths to be self-evident, that all men are created equal, that
they are endowed by their Creator with certain unalienable Rights, that among
these are Life, Liberty and the pursuit of Happiness. — That to secure these
rights, Governments are instituted among Men, deriving their just powers from
the consent of the governed, — That whenever any Form of Government becomes
destructive of these ends, it is the Right of the People to alter or to
abolish it, and to institute new Government, laying its foundation on such
principles and organizing its powers in such form, as to them shall seem most
likely to effect their Safety and Happiness. Prudence, indeed, will dictate
that Governments long established should not be changed for light and
transient causes; and accordingly all experience hath shewn that mankind are
more disposed to suffer, while evils are sufferable than to right themselves
by abolishing the forms to which they are accustomed. But when a long train of
abuses and usurpations, pursuing invariably the same Object evinces a design
to reduce them under absolute Despotism, it is their right, it is their duty,
to throw off such Government, and to provide new Guards for their future
security. — Such has been the patient sufferance of these Colonies; and such
is now the necessity which constrains them to alter their former Systems of
Government. The history of the present King of Great Britain is a history of
repeated injuries and usurpations, all having in direct object the
establishment of an absolute Tyranny over these States. To prove this, let
Facts be submitted to a candid world.
He has refused his Assent to Laws, the most wholesome and necessary for the
public good.
He has forbidden his Governors to pass Laws of immediate and pressing
importance, unless suspended in their operation till his Assent should be
obtained; and when so suspended, he has utterly neglected to attend to them.
He has refused to pass other Laws for the accommodation of large districts of
people, unless those people would relinquish the right of Representation in
the Legislature, a right inestimable to them and formidable to tyrants only.
He has called together legislative bodies at places unusual, uncomfortable,
and distant from the depository of their Public Records, for the sole purpose
of fatiguing them into compliance with his measures.
He has dissolved Representative Houses repeatedly, for opposing with manly
firmness his invasions on the rights of the people.
He has refused for a long time, after such dissolutions, to cause others to be
elected, whereby the Legislative Powers, incapable of Annihilation, have
returned to the People at large for their exercise; the State remaining in the
mean time exposed to all the dangers of invasion from without, and convulsions
within.
He has endeavoured to prevent the population of these States; for that purpose
obstructing the Laws for Naturalization of Foreigners; refusing to pass others
to encourage their migrations hither, and raising the conditions of new
Appropriations of Lands.
He has obstructed the Administration of Justice by refusing his Assent to Laws
for establishing Judiciary Powers.
He has made Judges dependent on his Will alone for the tenure of their
offices, and the amount and payment of their salaries.
He has erected a multitude of New Offices, and sent hither swarms of Officers
to harass our people and eat out their substance.
He has kept among us, in times of peace, Standing Armies without the Consent
of our legislatures.
He has affected to render the Military independent of and superior to the
Civil Power.
He has combined with others to subject us to a jurisdiction foreign to our
constitution, and unacknowledged by our laws; giving his Assent to their Acts
of pretended Legislation:
For quartering large bodies of armed troops among us:
For protecting them, by a mock Trial from punishment for any Murders which
they should commit on the Inhabitants of these States:
For cutting off our Trade with all parts of the world:
For imposing Taxes on us without our Consent:
For depriving us in many cases, of the benefit of Trial by Jury:
For transporting us beyond Seas to be tried for pretended offences:
For abolishing the free System of English Laws in a neighbouring Province,
establishing therein an Arbitrary government, and enlarging its Boundaries so
as to render it at once an example and fit instrument for introducing the same
absolute rule into these Colonies
For taking away our Charters, abolishing our most valuable Laws and altering
fundamentally the Forms of our Governments:
For suspending our own Legislatures, and declaring themselves invested with
power to legislate for us in all cases whatsoever.
He has abdicated Government here, by declaring us out of his Protection and
waging War against us.
He has plundered our seas, ravaged our coasts, burnt our towns, and destroyed
the lives of our people.
He is at this time transporting large Armies of foreign Mercenaries to
compleat the works of death, desolation, and tyranny, already begun with
circumstances of Cruelty & Perfidy scarcely paralleled in the most barbarous
ages, and totally unworthy the Head of a civilized nation.
He has constrained our fellow Citizens taken Captive on the high Seas to bear
Arms against their Country, to become the executioners of their friends and
Brethren, or to fall themselves by their Hands.
He has excited domestic insurrections amongst us, and has endeavoured to bring
on the inhabitants of our frontiers, the merciless Indian Savages whose known
rule of warfare, is an undistinguished destruction of all ages, sexes and
conditions.
In every stage of these Oppressions We have Petitioned for Redress in the most
humble terms: Our repeated Petitions have been answered only by repeated
injury. A Prince, whose character is thus marked by every act which may
define a Tyrant, is unfit to be the ruler of a free people.
Nor have We been wanting in attentions to our British brethren. We have warned
them from time to time of attempts by their legislature to extend an
unwarrantable jurisdiction over us. We have reminded them of the circumstances
of our emigration and settlement here. We have appealed to their native
justice and magnanimity, and we have conjured them by the ties of our common
kindred to disavow these usurpations, which would inevitably interrupt our
connections and correspondence. They too have been deaf to the voice of
justice and of consanguinity. We must, therefore, acquiesce in the necessity,
which denounces our Separation, and hold them, as we hold the rest of mankind,
Enemies in War, in Peace Friends.
We, therefore, the Representatives of the united States of America, in General
Congress, Assembled, appealing to the Supreme Judge of the world for the
rectitude of our intentions, do, in the Name, and by Authority of the good
People of these Colonies, solemnly publish and declare, That these united
Colonies are, and of Right ought to be Free and Independent States, that they
are Absolved from all Allegiance to the British Crown, and that all political
connection between them and the State of Great Britain, is and ought to be
totally dissolved; and that as Free and Independent States, they have full
Power to levy War, conclude Peace, contract Alliances, establish Commerce, and
to do all other Acts and Things which Independent States may of right do. —
And for the support of this Declaration, with a firm reliance on the
protection of Divine Providence, we mutually pledge to each other our Lives,
our Fortunes, and our sacred Honor.
''
• The set of input derivation names do not match:
- old
+ new
• The set of input derivations named `outputs` do not match
- /nix/store/sapk625xl072bdh8w7w7l3m1ii9lcc65-outputs.drv:{out}
+ /nix/store/vsfl2bqr1banhcpwf0f3aja5320ijiln-outputs.drv:{lib}
• The input derivation named `second_derivation` differs
- /nix/store/gq9mz7fsvxanbpw6m4qlriyxzj6j7id8-second_derivation.drv:{out}
+ /nix/store/0ijwj4k5vdyawhk12yghx3cdsic6w8ly-second_derivation.drv:{out}
• The input derivation named `soft_from_SW` differs
- /nix/store/f62l132ax7syr3l9y7y2413lmynq7wnh-soft_from_SW.drv:{out}
+ /nix/store/vyks8xqgrydzay393gjz4bkah9c75892-soft_from_SW.drv:{out}
• The platforms do not match
- R2D2_astrodroid
+ C3PO
• The builders do not match
- Anakin Skywalker
+ Luke Skywalker
• The environments do not match:
- missingEnvVaribale=value
+ newEnvVaribale=value
• The environments do not match:
derivations=''
←/nix/store/6hhm9alara3lijwww2sbm8bmf81x5j94-soft_from_SW←→/nix/store/qrn9pa2j5swdqld8h0rhlvpj5mjcbn5z-soft_from_SW→
''
• The input derivation named `third_derivation` differs
- /nix/store/j1jmbxd74kzianaywml2nw1ja31a00r5-third_derivation.drv:{out}
+ /nix/store/ww51c2dha7m5l5qjzh2rblicsamkrh62-third_derivation.drv:{out}
• The input derivation named `soft_from_SW` differs
• These two derivations have already been compared
• The environments do not match:
derivations=''
←/nix/store/6hhm9alara3lijwww2sbm8bmf81x5j94-soft_from_SW←→/nix/store/qrn9pa2j5swdqld8h0rhlvpj5mjcbn5z-soft_from_SW→
''
• The environments do not match:
derivations=''
←/nix/store/9dmp71si62hsgf2bi5g1ibkqdbwsv0zv-second_derivation←← ←←/nix/store/gvvxj52wd0s986ybx06gzrj8r2623fi9-third_derivation←← ←←/nix/store/5agf2p8f84fijdnlqy5mvwza3s2lic8l-old←← ←←/nix/store/10gqfacshzjzz0aayx29w5wrbcsbsa83-outputs←→/nix/store/1zy94ghyzk4f1r3alk4yhk2yvrm6x4ch-second_derivation→→ →→/nix/store/0xq8xmcxshwkai4rn55zb780pq8qdrbx-third_derivation→→ →→/nix/store/gz8x5pzvn6wpzk74m5nr7758iz8cvbsr-new→→ →→/nix/store/kqgpkfil6919d95c2vfyvdpb0fcfam30-outputs-lib→
''
srcs=''
←/nix/store/271h6y1jg7qizbqav8a34bhdaa6lvd64-changed-file←→/nix/store/7xawqkhd7p3d0brazmrv5zi8ki9w64wk-changed-file→ ←/nix/store/w1cqaspljnya9vxwyv25m6ak2crqjy7i-missing-file←→/nix/store/h9jy4njbp943nffs7sc9ycndmxmvgwwa-new-file→
''
Loading